![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on [LUA HELP NEEDED] file list in a directory within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; anyone know how to list and store the file names in a directory? im trying to add mp3 playback to ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() PREMIUM Member
|
anyone know how to list and store the file names in a directory?
im trying to add mp3 playback to my program but need to store the file names in the psp/music/ directory in an array or table if anyone knows how to do this please share
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
|
#3 | |
![]() ![]() Designs
|
Quote:
try files = System.listDirectory() for index, file in files do print(file.name) end
__________________
![]() |
|
|
|
|
|
|
#4 | |
![]() ![]() PREMIUM Member
|
Quote:
i tried that but it returns an error at the for index,file in files do .... line the error reads " Error: "index.lua:101: attempt to call a table value Error: No script file found
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
|
|
#5 | |
![]() ![]() is not posting very often
|
ooo, in the luaDevKit you'll go to the file i/o menu and click list files in current directory
__________________
Quote:
|
|
|
|
|
|
|
#6 | |
![]() ![]() PREMIUM Member
|
Quote:
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
|
|
#7 | |
![]() ![]() is not posting very often
|
http://forums.qj.net/f-psp-developme...ead-84179.html
my latest project, if there's enough intrest I'll be doing it, seems like it could be right up your street.
__________________
Quote:
|
|
|
|
|
|
|
#8 | |
![]() ![]() PREMIUM Member
|
Quote:
well, if its not released yet, would you mind shareing that pice of code with me?
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
|
|
#9 |
![]() ![]() sceKernelExitGame();
|
Look at the file browser in the Lua snippets thread( bottom )... Always check there before asking
__________________
|
|
|
|
|
|
#10 | |
![]() ![]() is not posting very often
|
@ Bronx, can i use some stuff from that for my app?
So theres an option- add menu... etc...
__________________
Quote:
|
|
|
|
|
|
|
#11 | |
![]() ![]() PREMIUM Member
|
Quote:
thanks that was helpfull however... i just reolized that the mp3 mod only plays mp3s from your lua programs directory ![]() if i try and give it something like Mp3.load("ms0:/psp/music/myfile.mp3") it will give me an error like this "error: index.lua:121: can't open sound file ms0:/psp/games/luaplayer20/applications/myapp/ms0:/psp/music/myfile.mp3") its hardcoded to look for "myfile.mp3" inside your app folder toobadso theres no way i can make it play from a list inside the psp/music folder ![]() UNLESS someone with better skills then me takes a look at the mp3 mod code and removes that limitation
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
|
|
#12 |
|
Alright ill help you with this and i can help more if youve got an IM oh and im tacticalpenguin but my real account got messed up from a vbplaza bug
anyways you could do something like this in conjunction with something like my filebrowser: if pad:circle() and not oldpad:circle() then if string.lower(string.sub(f iles[s].name, -4)) == ".mp3" then --checks that the file is .mp3 Mp3.load(files[s+2].name) System.sleep(30) Mp3.play() end end Just note that that is requiring the System.currentDirectory be the same as the dir the mo3 is in. If youd like, i made a little drop down bar with the psp/music folder contents in it and when you press circle it pays the MP3. If you need any help with file browser-related stuff, i can definitely hel |
|
|
|
|
|
|
#13 | |
![]() ![]() sceKernelExitGame();
|
Quote:
__________________
|
|
|
|
|
|
|
#14 | |
![]() ![]() is not posting very often
|
well, even if they don't they'll get it.
it'll add comments in e.g --menu code by *author*--
__________________
Quote:
|
|
|
|
|
|
|
#15 | |
![]() ![]() PREMIUM Member
|
Quote:
ok well thanks, im just gonna load the mp3s from my program folder and give up on the psp/music folder, thanks for the code for checking if mp3 file verri nice. enyway the program i was working on is a life counter for Warcraft Trading Card Game. its pretty handy up and down increas and decrease your life counter and triangle and x increase derease your opponent's life. and i just wanted to have some sort of music playing while we dual it out. here is a screen shot:
__________________
My Releases In No Particular Order: ---------------------------------- TetriAbetes 1.21 | Metroid Life 0.03 | PSP Phone Dialer 0.02 | Test Your Might | Super Turbo Turkey Puncher 3 Nort v0.4 | Star Wars: Rocks 1.02 |Color Blocks | LUAmines 0.06b | LUAmines Patch to 0.6C | LUAmines Lite: Mario Edition Super Random Card Fighter 2 Special Champion Edition Alpha V0.3 |
|
|
|
|
![]() |
| Tags |
| directory , file , list , lua , needed |
| Thread Tools | |
|
|