iphoneobjective-ciosaudioqueue

How to set volume in AudioQueue without the use of AudioQueueRef?


How to set volume in AudioQueue wthout the use of AudioQueueRef?

I have refered many question regarding this on Stack Overflow but all of them use AudioQueueRef object.

Is it possible to do so without use of AudioQueueRef?


Solution

  • Try with the previous post. Though the question is different but you can use following code out of that ticked answer. Refer this below code in previous post.

    OSStatus errorMsg = AudioQueueSetParameter(audioQueue, kAudioQueueParam_Volume, Level);
    
        if (errorMsg) {
            NSLog(@"AudioQueueSetParameter returned %d when setting the volume.", errorMsg);
        }
    

    for above code refer to documentation Controlling the Playback Level

    Also refer other answers too. Also I think MPVolumeView is working with AudioQueue so you can use that also.