Rinnegatamante / lpp-vita

Lua Player Plus for PSVITA. Documentation on: http://rinnegatamante.github.io/lpp-vita/
GNU General Public License v3.0
179 stars 27 forks source link

Sound.open does not detect audio file format #55

Closed raxracks closed 2 years ago

raxracks commented 3 years ago

I am definitely using a working mp3, it plays fine inside VitaShell, but when I try to open it with Sound.open I just get this error:

unknown audio file format.

This is my code, am I doing something wrong?

local white = Color.new(255,255,255)

Sound.init()

local snd = Sound.open("ux0:/audio.mp3")
Sound.play(snd, LOOP)

while true do
    local pad = Controls.read()
    if Controls.check(pad, SCE_CTRL_CIRCLE) and Sound.isPlaying(snd) then
        Sound.pause(snd)
    elseif Controls.check(pad, SCE_CTRL_SQUARE) and not Sound.isPlaying(snd) then
        Sound.resume(snd)
    end

    Graphics.initBlend()
    Screen.clear()
    Graphics.debugPrint(5, 20, "Press CIRCLE to pause sound.", white)
    Graphics.debugPrint(5, 40, "Press SQUARE to resume sound.", white)
    Screen.flip()

end

Any help is appreciated, thanks :)

Rinnegatamante commented 2 years ago

You are likely using a safe build that doesn't have access to anything but ux0:data and app0: