语言

Menu
Sites
Language
Using AudioDecoder to load audio assets

Hi,

 

I'm working in a project where I'm loading multiple audio files(ogg vorbis files) into memory and decode them. I'm using AudioDecoder as instructed in the reference pages. It's successfully decoding the first file I feed(and doesn't matter which one I feed first) but starts failing in AudioDecoder::Probe() for the files coming after. I tried calling AudioDecoder::Reset() before calling AudioDecoder::Probe() and AudioDecoder::Decode() but that doesn't seem to help either.

 

I'd appreciate any help.

Thanks,

-Üstün

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

3 回复
Alex Dem
Hi, Maybe you have missed something in your code, but it is not clear from your description. Here are AudioDecoder working example: https://developer.tizen.org/help/index.jsp?topic=/org.tizen.native.apireference/classTizen_1_1Media_1_1AudioDecoder.html It works fine on Tizen 2.2.0 official. But I have checked on device (not on emulator) with small *.ogg files ,100-300 Kbytes. You need to analyze occured error. What result Probe() returns... etc Alexey.
Üstün Ergenoglu
The only difference is that I'm keeping a member AudioDecoder object in my class so that I can reuse it. And each time before I use it to probe and decode a stream I call AudioDecoder::Reset(). When I change my code to keep a local AudioDecoder in the method I'm calling from my app, it decodes fine all the files. But when I'm doing this I experience lockups every now and then. I'm not sure if it's caused by this but at least I couldn't reproduce it when I'm using only one AudioDecoder object for a certain type of codec. Should I be creating a new AudioDecoder every time I need to decode a file or can an AudioDecoder object be used over and over again? When I am trying to use AudioDecoder::Probe for the second time it's always failing with E_SYSTEM.
Alex Dem
It looks like an error. I was able to decode audio with the same AudioDecoder instance only one time. I agree with you that AudioDecoder::Reset() should allow to reuse instance of AudioDecoder, otherwise it is wasted method. In Tizen->nativeApp->Sample->Media example new AudioDecoder instance is created every time for decoding also. Alexey.