语言

Menu
Sites
Language
Decode audio stream to the file.

Hello.

I wanna decode and write audiostream from internet to wav file.

I do httpRequest,then decode buffer and save it to a file.

ByteBuffer* pBuffer = pHttpResponse->ReadBodyN();

ByteBuffer *tempbyteBuffer = new ByteBuffer;
tempbyteBuffer->Construct(availableBodyLen);
r = decoder.Decode(*pBuffer, *tempbyteBuffer);

__wavFile.Write(*tempbyteBuffer);

 

But when i try to open file - it shows error message.

How to resolve this issue?

Thanks.

 

编辑者为: Egor Chebotarev 13 3月, 2014

响应

2 回复
Alex Dem

Hi,
But maybe all you need is to use Tizen::Media::Player::OpenUrlAsync     (url,    filePath,
listener,    pHeader) and store stream in file created before (path to the file is filePath param)
     filePath:     The file path on the local file system where the downloaded content is saved

Regarding how to decode look at this:
https://developer.tizen.org/dev-guide/2.2.0/org.tizen.native.apireference/classTizen_1_1Media_1_1AudioDecoder.html
And see mediaApp Native example also.

Alexey.

Egor Chebotarev

I saw it but have errors with it.

 

https://developer.tizen.org/dev-guide/2.2.0/org.tizen.native.apireference/classTizen_1_1Media_1_1AudioDecoder.html

 

  // Adds code handling decoded data // How to use decode data?