newMusic problem

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Neptar
Prole
Posts: 20
Joined: Mon Feb 16, 2009 3:24 am
Location: England

newMusic problem

Post by Neptar »

When I try to use the newMusic function I get an error stating that it could not load the file. I tried everything to resolve this issue by placing the file in many different directories. It works fine if I use newSound.

My first idea was that the sound file had to be outside of the love file, as when you merger the love file with love.exe to create your game exe I would assume the music file would be seperate from that exe so it can decoded during runtime. But I am not sure how to direct it to the file once it's outside the love file.

I am probably totally wrong. Any advice on how to use this would be much appreciated. Or is it a known problem? I have searched the forum but the only reference I found to newMusic was the release notes.

Many Thanks
User avatar
Skofo
Party member
Posts: 146
Joined: Mon Dec 22, 2008 10:55 pm

Re: newMusic problem

Post by Skofo »

What kind of audio file are you trying to use? Music can be in MP3, OGG, MIDI, XM, MOD, or other tracker formats.
Working on: Viator
Need a 64-bit Debian package for LÖVE? Here it is!
lbhoward
Prole
Posts: 23
Joined: Tue Feb 17, 2009 6:12 pm

Re: newMusic problem

Post by lbhoward »

Just as Skofo said - 'Music' files can only be in MP3, OGG, MIDI, XM, MOD and only one 'Music' file can play at a time, and 'Sound' files can be WAVE, OGG, AIFF, RIFF and VOC and you can have 8 (I believe) playing at one time.

You should also be careful as to what Bitrate and Frequency you set your songs/sounds to - I've noticed the Mixer can 'reject' some sounds and playing them really squeaky and fast.

http://www.nch.com.au/wavepad/: WavePad Free Edition is an excellent tool for editting sounds and it handles many of the Formats mentioned above.
User avatar
Neptar
Prole
Posts: 20
Joined: Mon Feb 16, 2009 3:24 am
Location: England

Re: newMusic problem

Post by Neptar »

I have tried the music in both wav form and mp3 form, i realise in the documentation it says wav files will not work with Music but I thought I'd try after mp3 didn't work for me. I have tried several bitrates and frequencies, but I would have thought 44.1Khz would be the standard.

I take it you chaps have had success with this?

Update:

Tried saving as Ogg Vorbis and it works.... But no joy with mp3's. Could be a localized problem with my machine but I doubt it very much as I use this machine for recording music. And can play mp3's with other software with no problem.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: newMusic problem

Post by osuf oboys »

Neptar wrote:I have tried the music in both wav form and mp3 form, i realise in the documentation it says wav files will not work with Music but I thought I'd try after mp3 didn't work for me. I have tried several bitrates and frequencies, but I would have thought 44.1Khz would be the standard.

I take it you chaps have had success with this?

Update:

Tried saving as Ogg Vorbis and it works.... But no joy with mp3's. Could be a localized problem with my machine but I doubt it very much as I use this machine for recording music. And can play mp3's with other software with no problem.
That mp3s does not work in LÖVE for non-windows platforms is known and has to do with one of the LÖVE uses.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
lbhoward
Prole
Posts: 23
Joined: Tue Feb 17, 2009 6:12 pm

Re: newMusic problem

Post by lbhoward »

On a side note - I just tried .MP3 files with Vista - no luck!

It seems .MP3 files do not with most platforms, but .OGG always does the trick for me.
philnelson
Prole
Posts: 48
Joined: Sun Feb 01, 2009 3:32 am

Re: newMusic problem

Post by philnelson »

I have a problem with newMusic, too. After saving my .ogg file using Audacity (Mac OS 10.5), it just sounds like when it's played back. Here's the file: http://philname.s3.amazonaws.com/wpfile ... _audio.ogg

It sounds fine on it's own, in any music player. I'm not sure what the problem is. When I play it in Love2d, I get this horrible reverb. It's hard to describe.

The sound file is already INTENTIONALLY low quality, but what I hear in love2d is not what I hear in Audacity, or any other audio player.
User avatar
Neptar
Prole
Posts: 20
Joined: Mon Feb 16, 2009 3:24 am
Location: England

Re: newMusic problem

Post by Neptar »

philnelson wrote:I have a problem with newMusic, too. After saving my .ogg file using Audacity (Mac OS 10.5), it just sounds like when it's played back. Here's the file: http://philname.s3.amazonaws.com/wpfile ... _audio.ogg

It sounds fine on it's own, in any music player. I'm not sure what the problem is. When I play it in Love2d, I get this horrible reverb. It's hard to describe.

The sound file is already INTENTIONALLY low quality, but what I hear in love2d is not what I hear in Audacity, or any other audio player.
Where abouts in your code have you placed this? It sounds like you could be constantly triggering it, giving it a reverb effect. Although if you are using newMusic rather than newSound, it shouldn't play it over the other sound, it would restart the music which could be what you are hearing?

I downloaded it, and it sounds the same in love as it does with other programs. Tried with winamp and sound forge.
User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: newMusic problem

Post by osgeld »

off topic:

i love your avatar Neptar, i ran into him once, when he briefly was hanging out around here, i turned around, there he was and i said "sup MR T!", i got a smile and a "not much", and we continued about our ways
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 2 guests