audioqueueservices

Example of using Audio Queue Services

╄→尐↘猪︶ㄣ 提交于 2019-11-28 16:07:28
I am seeking an example of using Audio Queue Services. I would like to create a sound using a mathematical equation and then hear it. Here's my code for generating sound from a function. I'm assuming you know how to use AudioQueue services, set up an AudioSession, and properly start and stop an audio output queue. Here's a snippet for setting up and starting an output AudioQueue: // Get the preferred sample rate (8,000 Hz on iPhone, 44,100 Hz on iPod touch) size = sizeof(sampleRate); err = AudioSessionGetProperty (kAudioSessionProperty_CurrentHardwareSampleRate, &size, &sampleRate); if (err !=

AudioQueueStart fail -12985

自古美人都是妖i 提交于 2019-11-28 00:29:57
问题 I made a streaming music player and it works fine in the foreground. But in the background iOS4, it doesn't play the next song automatically. ( remote control works ) The reason is AudioQueueStart return -12985 . I already check the audio session. it just fine. I use AudioQueueStart when it start to play the music. How can you remove AudioQueueStart ? - (void)play { [self setupAudioQueueBuffers]; // calcluate the size to use for each audio queue buffer, and calculate the // number of packets

Objective-c - How to serialize audio file into small packets that can be played?

左心房为你撑大大i 提交于 2019-11-27 12:37:13
问题 So, I would like to get a sound file and convert it in packets, and send it to another computer. I would like that the other computer be able to play the packets as they arrive. I am using AVAudioPlayer to try to play this packets, but I couldn't find a proper way to serialize the data on the peer1 that the peer2 can play. The scenario is, peer1 has a audio file, split the audio file in many small packets, put them on a NSData and send them to peer2. Peer 2 receive the packets and play one by