Background music not playing correctly - distorted - static - using audio.loadStream only on Windows

Hi, I am new to the forum, and new to Corona SDK. I am currently taking a Udemy course using Corona SDK and an editor called Outlaw. I am having audio issues. I’m using the sample files that are provided in the course. I am using Mac at home and Windows 7 in the office. On the Mac, everything is working fine. However, on the Windows machine, I am having audio issues. In the demo that I am currently learning, the audio files that are using audio.loadSound work fine. No issues with them at all. It is only when I am playing background music using audio.loadStream when I experience issues. The sound is played on the Corona Simulator as pure static, distortion. When I play the audio file on my computer, it is fine. I even tried using a different wav file. But no matter what I use, in the simulator, the audio is static and distorted. 

Any help would be greatly appreciated. 

Thanks!

Hi @rfernan,

Welcome to Corona! Which version of Corona SDK are you using? Check by going to “Corona Simulator > About Corona Simulator” (Mac) or similar on Windows, and find the version number.

Best regards,

Brent

Hi Brent,

I am using 2015.2731 (2015.10.5)

Also, I tried replacing the wav file with an ogg file, and that did work, so the problem seems to be only with wav files. 

Thanks

This sounds like a potential audio driver issue. Are you drivers fully up to date?

Brent

Strange. I checked drivers, and they are all updated. However, I am guessing that this is some problem on my PC. It works fine on my Mac. Thanks

Is your Corona project directory on a network share?

That is, is you Corona project not on your local hard drive, such as “C:”?

I ask because the Lua audio.loadStream() function won’t load and decode the entire audio file into memory.  Instead, it streams from file directly from the hard disk.  The intent is to use this API for very large audio files for memory efficiency, which is especially important on low-end mobile devices with little RAM.  So, if you’re streaming via a network share, then odds are the file’s audio data will not be read in-time (depending on the speed of the network) and you might here a skipping sound.  Although, I wouldn’t expect any static in the audio playback.  A staticky sound does suggest a decoding issue.  I’ve never heard of this happening to a Windows user of Corona before.

No. The project is located on my C: Drive. 

Try running sample project “Media\AudioPlayer” that is included with the Corona Simulator and play one of the MP3 files.  Those files go through our audio.loadStream() API too.  Our “Media\SimpleMixer” uses the audio.loadStream() API too.  The idea is to prove whether or not your system’s DirectX audio decoders are working fine.

Interesting. That did work. However, using the code from the course that I am currently taking, a few different mp3’s did not work. I guess this could be a coding issue? 

Okay.  So, it sounds like it might be an issue with how the MP3 file is encoded.  Would you mind send us that MP3 files please?

We can then give it a go on our end to see if there is anything we can do on our end.

You can send us that file by clicking the “Report a Bug” link at the top of this web page.  And please reference this forum thread in the report.

In the meantime, I suppose the thing to do is to use a different audio file at the moment.

Joshua, 

I attempted to submit the audio file, but I received an error: The file ‘electrohouse.wav’ is too large (14068 KB). Please upload a file 5000 KB or smaller.

Hi @rfernan,

Welcome to Corona! Which version of Corona SDK are you using? Check by going to “Corona Simulator > About Corona Simulator” (Mac) or similar on Windows, and find the version number.

Best regards,

Brent

Hi Brent,

I am using 2015.2731 (2015.10.5)

Also, I tried replacing the wav file with an ogg file, and that did work, so the problem seems to be only with wav files. 

Thanks

This sounds like a potential audio driver issue. Are you drivers fully up to date?

Brent

Strange. I checked drivers, and they are all updated. However, I am guessing that this is some problem on my PC. It works fine on my Mac. Thanks

Is your Corona project directory on a network share?

That is, is you Corona project not on your local hard drive, such as “C:”?

I ask because the Lua audio.loadStream() function won’t load and decode the entire audio file into memory.  Instead, it streams from file directly from the hard disk.  The intent is to use this API for very large audio files for memory efficiency, which is especially important on low-end mobile devices with little RAM.  So, if you’re streaming via a network share, then odds are the file’s audio data will not be read in-time (depending on the speed of the network) and you might here a skipping sound.  Although, I wouldn’t expect any static in the audio playback.  A staticky sound does suggest a decoding issue.  I’ve never heard of this happening to a Windows user of Corona before.

No. The project is located on my C: Drive. 

Try running sample project “Media\AudioPlayer” that is included with the Corona Simulator and play one of the MP3 files.  Those files go through our audio.loadStream() API too.  Our “Media\SimpleMixer” uses the audio.loadStream() API too.  The idea is to prove whether or not your system’s DirectX audio decoders are working fine.

Interesting. That did work. However, using the code from the course that I am currently taking, a few different mp3’s did not work. I guess this could be a coding issue? 

Okay.  So, it sounds like it might be an issue with how the MP3 file is encoded.  Would you mind send us that MP3 files please?

We can then give it a go on our end to see if there is anything we can do on our end.

You can send us that file by clicking the “Report a Bug” link at the top of this web page.  And please reference this forum thread in the report.

In the meantime, I suppose the thing to do is to use a different audio file at the moment.