简体   繁体   中英

iPhone, play raw data in byte form as an audio

I have raw data in byte form and I want to play it when my application starts. The byte stream will be streamed in every few seconds and I need to play it so it should also have very low latency. Please provide sample code, if possible. Thank you.

Look at Apple's sample iOS application aurioTouch (somewhere on developer.apple.com) for example code on how to use the Audio Unit RemoteIO API to play raw audio PCM sample buffers. You can also use the Audio Queue API, but the RemoteIO API provides the lowest latency. These are not simple APIs that can be properly described with only a few lines of sample code.

Another possible way to play raw audio is to use the OpenAL library.

Here are some apple examples of loading and playing audio files using raw PCM audio streams: OpenALExample and oalTouch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM