Audio file not loading

So, I’ve been trying to get the audio library to work with this code:[lua]local buttonSound = audio.loadSound(“Sound/blop.wav”)

audio.play(buttonSound)

[/lua]

And getting this error:

I have no idea what I’m doing wrong. My file is in the location specified in the code relative to ‘main.lua’. So, I need your help, Mr./Ms. Smart Person!

Thanks!  :slight_smile:

P.S. The ‘Audio Volumes’ is me logging me setting volumes.

Welcome to the forums!

Its really helpful if you learn to copy/paste messages like this rather than doing screen grabs.  I can’t copy relevant parts of the message.

Any way, if you read the message, it says you have an invalid file.  The first message says it can’t find a valid MPEG header.  The second message says “sound format unsupported”.  Since you seem to be loading a .wav which is a supported format, that indicates that file itself is corrupt.

Rob

I would copy and paste if the console would let me. I guess I’ll just copy it by typing.

The file shouldn’t be corrupt. I can play it in windows. Just not in the simulator. I’m assuming the sim must be more sensitive to currupt files? How would I fix that?

You can either right click and do a “Select All” and hit enter to grab the whole screen.  Or you can right-click, choose Mark, then use your mouse to highlight the area of the screen and hit enter to grab what’s selected.

You can then CTRL-V here in the typing area to paste it in.

Rob

Thanks, but how do I fax the currupt file?

P.S. Awesome reply time!

Depends on the problem, where you got it, how you got it etc.

Many people use Audacity, a free sound editor to work on things, but it likely won’t open a corrupt audio file either.  I would go back to the source.

Rob

Ok, thanks.

@oneORthr33 and others,

Here is a video showing how to enable cut-copy-paste from your windows Console window so you don’t have to type out long console logs in the future:

https://www.youtube.com/watch?v=N6YC0O5EDXY&feature=youtu.be&hd=1

One other thing to add to what Rob said.  I’ve seen errors like that when receiving audio files from clients.  Rob is right.  You should be able to load that file into Audacity (and assuming it loads) you can export it as a WAV or a MP3 file and the problem will be fixed.

-Ed

Thanks for the help guys! Really appreciated it.  :slight_smile:

Welcome to the forums!

Its really helpful if you learn to copy/paste messages like this rather than doing screen grabs.  I can’t copy relevant parts of the message.

Any way, if you read the message, it says you have an invalid file.  The first message says it can’t find a valid MPEG header.  The second message says “sound format unsupported”.  Since you seem to be loading a .wav which is a supported format, that indicates that file itself is corrupt.

Rob

I would copy and paste if the console would let me. I guess I’ll just copy it by typing.

The file shouldn’t be corrupt. I can play it in windows. Just not in the simulator. I’m assuming the sim must be more sensitive to currupt files? How would I fix that?

You can either right click and do a “Select All” and hit enter to grab the whole screen.  Or you can right-click, choose Mark, then use your mouse to highlight the area of the screen and hit enter to grab what’s selected.

You can then CTRL-V here in the typing area to paste it in.

Rob

Thanks, but how do I fax the currupt file?

P.S. Awesome reply time!

Depends on the problem, where you got it, how you got it etc.

Many people use Audacity, a free sound editor to work on things, but it likely won’t open a corrupt audio file either.  I would go back to the source.

Rob

Ok, thanks.

@oneORthr33 and others,

Here is a video showing how to enable cut-copy-paste from your windows Console window so you don’t have to type out long console logs in the future:

https://www.youtube.com/watch?v=N6YC0O5EDXY&feature=youtu.be&hd=1

One other thing to add to what Rob said.  I’ve seen errors like that when receiving audio files from clients.  Rob is right.  You should be able to load that file into Audacity (and assuming it loads) you can export it as a WAV or a MP3 file and the problem will be fixed.

-Ed

Thanks for the help guys! Really appreciated it.  :slight_smile: