System Extension (v0.5,cpu,elf loading,mp3,zip)
Moderators: Shine, Insert_witty_name
not sure if i'm just using it wrong or what, but i couldnt get this to work at all. i tried everything i could think of (i put the lrx file in about 5 locations, all at once, i messed around with the variables in the loadlib call, tried sysext.quit/System.quit() in about 10 different combinations...).cools wrote:I cant seem ogg to work. Can someone post an example if they got ogg working? Thanks!
i have a feeling its something simple but it's bested me... for the night anyways :D
heres my test code:
Code: Select all
sysext = loadlib("sysext","init")
if sysext then sysext() end
System.usbDiskModeActivate()
green = Color.new(0, 255, 0)
yellow = Color.new(255, 255, 0)
cyan = Color.new(0, 255, 255)
oldpad = Controls.read()
System.quit()
while true do
pad = Controls.read()
if pad:start() and oldpad:start() ~= pad:start() then
break
end
oldpad = pad
screen.waitVblankStart()
screen.flip()
end
While i was messing around with it, it would run this code:
but it wouldnt playback the ogg file and eventually turned off the psp.
Also whenever i attempted to call Ogg.end() it would give me an error message...
The system functions work.
Code: Select all
sysext = loadlib("sysext","init")
if sysext then sysext() end
Ogg.init()
Ogg.load("test.ogg")
Ogg.play()
while true do
if Controls.read():start() then break end
screen:clear()
screen:print(0,0,"Ogg Test",Color.new(255,255,255))
screen.flip()
screen.waitVblankStart()
end
Also whenever i attempted to call Ogg.end() it would give me an error message...
The system functions work.
long time...
sorry i havent been on in a while, i had alot going on, but some people seem to want mp3, so i made an mp3player.lrx real quick and i need some people to test it out...
about the ogg... im about 100% sure that it is broken
and about the System.Quit(), it works... the "Q" in quit MUST be capitalized... lua is anal like that, you were putting System.quit()
all lrx files you want to use must be in the same directory as the EBOOT.PBP
so for me it is: "ms0:/PSP/GAME/LUAPLAYER/"
i will try and get ogg working if anyone still wants it since i just made an mp3 player... but seriously, i need feedback on the mp3 player
p.s. ignore the zip support, it was just a test and i completely sucked at it!
http://www.angelfire.com/blog/dev-be2003/mp3player.lrx
you may have to right click and "Save as" if right clicking doesnt work
about the ogg... im about 100% sure that it is broken
and about the System.Quit(), it works... the "Q" in quit MUST be capitalized... lua is anal like that, you were putting System.quit()
all lrx files you want to use must be in the same directory as the EBOOT.PBP
so for me it is: "ms0:/PSP/GAME/LUAPLAYER/"
i will try and get ogg working if anyone still wants it since i just made an mp3 player... but seriously, i need feedback on the mp3 player
p.s. ignore the zip support, it was just a test and i completely sucked at it!
http://www.angelfire.com/blog/dev-be2003/mp3player.lrx
you may have to right click and "Save as" if right clicking doesnt work
- be2003
blog
blog
Re: long time...
thanks for that. i didnt even realize that the "Q" was capitalized on the readme. i need to learn how to read before i can rtfm i guess.
it just freezes and i have to reboot the psp. i'm thinking i'm having a problem with the first two lines but ive tried a few different combinations (i cant find any documentation on the loadlib function from the lua player wiki or anywhere else for that matter):
edit: ps, my mp3 file is 6.37 MB (6,680,344 bytes), 04:15 mm:ss, 320 kbps, 44khz, 2 channel audio.
i may not be the best person to test this out, because i'm having problems again... using this code:be2003 wrote:... but seriously, i need feedback on the mp3 player
Code: Select all
sysext = loadlib("mp3player","init")
if sysext then mp3player() end
Mp3.init()
Mp3.load("g.mp3")
Mp3.play()
while true do
if Controls.read():start() then break end
screen:clear()
screen:print(0,0,"Mp3 Test",Color.new(255,255,255))
screen.flip()
screen.waitVblankStart()
end
i changed the first "mp3player" to mp3player because i figure thats the lrx name. and i figured the second "mp3player" is the name of the function that needs to be called to initialize the lrx (like the main function in c programming). i also tried the second "mp3player" being called "sysext" cuz i figured you just renamed the file but didnt change the names when you compiled it. oh well. sorry i couldnt be more help. hope its not me just goofing it up again :Dsysext = loadlib("mp3player","init")
if sysext then mp3player() end
edit: ps, my mp3 file is 6.37 MB (6,680,344 bytes), 04:15 mm:ss, 320 kbps, 44khz, 2 channel audio.
I tried using this in a few different ways, none of them would work properly.
Also libmad has some restrictions, like filesize (I think it is supposed to be under 2mb), bitrate (below 128kbs i think), there might others. But if you used a custom libmad, then there wont be those limitations.
I tried files both within and not within the restrictions. It didnt work.
Also libmad has some restrictions, like filesize (I think it is supposed to be under 2mb), bitrate (below 128kbs i think), there might others. But if you used a custom libmad, then there wont be those limitations.
I tried files both within and not within the restrictions. It didnt work.
damn, it should have... idk
try this...
i changed the mp3 a bit...
Mp3.play("filename") plays the filename... like "test.mp3"
Mp3.pause() pauses it
Mp3.resume() resumes it
Mp3.stop() stops and unloads it... call this before you exit, frees up memory and stops playing the music, etc...
Mp3.finished() returns 1 if it is done and 0 if it isnt :)
hope this works instead, sorry for not including the new instuctions
try this...
Code: Select all
mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end
Mp3.play("test.mp3")
while true do
if Controls.read():start() then
Mp3.stop()
break
end
screen:clear()
screen.print(5,5,"MP3 PLAYIZZLE!",Color.new(255,255,255))
screen.waitVblankStart()
screen.flip()
end
Mp3.play("filename") plays the filename... like "test.mp3"
Mp3.pause() pauses it
Mp3.resume() resumes it
Mp3.stop() stops and unloads it... call this before you exit, frees up memory and stops playing the music, etc...
Mp3.finished() returns 1 if it is done and 0 if it isnt :)
hope this works instead, sorry for not including the new instuctions
- be2003
blog
blog
i cant get this to runbe2003 wrote:hope this works instead, sorry for not including the new instuctions
Code: Select all
mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end
--Mp3.play("test.mp3")
while true do
if Controls.read():start() then
-- Mp3.stop()
break
end
screen:clear()
screen.print(5,5,"MP3 PLAYIZZLE!",Color.new(255,255,255))
screen.waitVblankStart()
screen.flip()
end
If i just do the loadlib part by itself it works.
just
That works.
If I add in an Mp3.play("test.mp3") it returns the error:
attempt to index global `Mp3` (a nil value)
just
Code: Select all
mp3player = loadlib("mp3player","init")
if mp3player then mp3player() end
If I add in an Mp3.play("test.mp3") it returns the error:
attempt to index global `Mp3` (a nil value)
Sysext by be2003 for Luaplayer
-----------------------------------
version 0.6
-----------------------------------
MP3 ABOLISHED! lol, just switched to ogg, yup, i'm serious.
umm... here we go:
Added:
Ogg.init() initializes ogg player
Ogg.play() plays the loaded ogg
Ogg.pause() pauses loaded ogg
Ogg.stop() stops loaded ogg
Ogg.end() ends loaded ogg
Ogg.load(file) loads file as ogg (relative to current path)
Ogg.freeTune() removes loaded ogg from ram
Ogg.getTimeString() call like this 'oggtime = Ogg.getTimeString()' it returns time of ogg in HH:MM:SS form as a string or do:
screen.print(5,5,Ogg.getTimeString(),green) --sample
Ogg.endOfStream() return true if the ogg is over, false if it isnt
Re: long time...
A More recent quote frim be2003 about mp3.be2003 wrote:...
i will try and get ogg working if anyone still wants it since i just made an mp3 player... but seriously, i need feedback on the mp3 player
...
damn its been a while since i have done this... i will check out the mp3 player's source and make sure the makefile and exports.exp are ok, but the code looks straight forward. if some more experienced devs want to look at the source just tell me. it is based on the source from psp mediacenter
- be2003
blog
blog