renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2015
10:48 PM
Crashing 7.0 with invalid roAudioResource
I don't have a Roku 4 (yet) so I don't know if the latest v7 build has the same bug, but on my Roku 3 running v7.0 build 8637 if you try to create an roAudioResource with a bad file it causes a crash and reboot. The following code will do the trick:
I stumbled upon this when I was trying to play a sound effect that I thought was a regular WAV file, but it turns out it was a WAV file that used an MP3 codec. I didn't even know that was possible.
Older versions of the firmware (< 7.0) don't have the same issue.
-JT
ba = CreateObject("roByteArray")
ba[0] = 0
ba.WriteFile("tmp:/sound.wav")
ar = CreateObject("roAudioResource","tmp:/sound.wav") ' <- crash and burn
I stumbled upon this when I was trying to play a sound effect that I thought was a regular WAV file, but it turns out it was a WAV file that used an MP3 codec. I didn't even know that was possible.
Older versions of the firmware (< 7.0) don't have the same issue.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
4 REPLIES 4
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015
06:12 AM
Re: Crashing 7.0 with invalid roAudioResource
It's not possible. Whatever file you used had mp3 with the wrong extension.
Anyway, good tip here to avoid a crash, thanks.
Anyway, good tip here to avoid a crash, thanks.

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015
08:36 AM
Re: Crashing 7.0 with invalid roAudioResource
While it's uncommon, it's possible for WAV files to contain compressed audio such as MP3. The FormatTag field in the WAV header specifies the type of audio encoding.
I've filed a bug report for the crash.
--Mark
I've filed a bug report for the crash.
--Mark
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015
10:45 AM
Re: Crashing 7.0 with invalid roAudioResource
Learn something new every day I guess -- now anything can be a wav file - great.
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015
02:19 PM
Re: Crashing 7.0 with invalid roAudioResource
Yeah, it definitely had a WAV header. That's why I was surprised it didn't play/crashed. It's only after I looked at it more closely that I noticed the format wasn't PCM as expected (and to be honest, I thought the only option for WAVs); it was "MPEG Audio".
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.