forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems loading sound files

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
exzantia



Joined: 03 Oct 2005
Posts: 4

PostPosted: Thu Mar 16, 2006 7:45 pm    Post subject: Problems loading sound files Reply with quote

Can anyone help me out with loading sound files in Lua? Every time I attempt to load a sound file it just gives me an error:

"error: index.lua:142: error loading sound"

142: a_sound = Sound.load("a.wav")

Do I need to do something to t he wav file to make it compatible?

I amn't too sure of what I am doing but I would really appricatite some help, this is for a graded project and I need to have sounds working in 4 days!
Back to top
View user's profile Send private message
ShUr1k3n



Joined: 16 Oct 2005
Posts: 42

PostPosted: Fri Mar 17, 2006 5:06 am    Post subject: Reply with quote

1st -> See if that file exists...(the directory, etc)
2nd -> Is that the only sound that u are loading?
3rd -> The size of the sound (shouldn't be very "large")

Check these 3 steps.

If you still having problems, post here some part of ur code!

Regards,

ShUr1k3n
Back to top
View user's profile Send private message Send e-mail
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Mar 18, 2006 5:02 am    Post subject: Re: Problems loading sound files Reply with quote

exzantia wrote:

Do I need to do something to t he wav file to make it compatible?


Yes, save it as normal PCM (you can convert it e.g. with the Windows sound recorder). Any special Microsoft codecs or other formats are not supported.
Back to top
View user's profile Send private message
exzantia



Joined: 03 Oct 2005
Posts: 4

PostPosted: Sun Mar 19, 2006 8:00 pm    Post subject: Reply with quote

Yay!

That got it working for me :)

Thanks Shine
Back to top
View user's profile Send private message
ZORDAK



Joined: 21 Jan 2006
Posts: 12
Location: Spain

PostPosted: Fri Mar 24, 2006 11:28 am    Post subject: Reply with quote

hi

Im using a 1.3 wav file pcm 8 bit mono, i getting this error trying to load it.

LuaPlayer's Mikmod has a critical error:
_mm_critical 0
_mm_errno 14
Unknown module format 3 [unknown (0x7C4)] luaplayer 840 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 450 [unknown (0x7C4)] luaplayer 840 open_stackdumpfile: Dumping stack trace to luaplayer.exe.stackdump

The problem is when i use

Music.volume(128)
Music.playFile("Data/Mus/track.wav", true)


Using wav files it crashed but if i use the play method ...

musica= Sound.load("Data/Mus/track.wav")
musica:play()

it sound fine, the problem is that i want use the wav file for a background music, and i cant get it looping infinite and stopping when i want.

How i can solve this?

Thanks in advance.
Back to top
View user's profile Send private message Visit poster's website
Kameku



Joined: 23 Mar 2006
Posts: 32
Location: Oregon, USA

PostPosted: Fri Mar 24, 2006 12:19 pm    Post subject: Reply with quote

Couldn't you just toss in an if statement checking to see if it's playing?

Like:
Code:
if not music:playing() then
 music:play()
end

I dunno.

[EDIT] Just checked the wiki, and you can just put
Code:
Sound.load(filename, [bool loop])

So, maybe
Code:
musica = Sound.load("a.wav", true)
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ZORDAK



Joined: 21 Jan 2006
Posts: 12
Location: Spain

PostPosted: Fri Mar 24, 2006 10:56 pm    Post subject: Reply with quote

Using the loop works fine, but how i stop the playing?

Using musica.stop() dont work, i getting this "loop in gettable"
Back to top
View user's profile Send private message Visit poster's website
Kameku



Joined: 23 Mar 2006
Posts: 32
Location: Oregon, USA

PostPosted: Sat Mar 25, 2006 2:16 am    Post subject: Reply with quote

Try using a colon instead of a period.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group