2

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • 1
    Why do you not want to use an AudioQueueRef? That is simply a pointer to an Audio Queue object, so if you're using Audio Queues you have an AudioQueueRef somewhere. – Hollance Sep 14 '11 at 09:47
  • @Hollance: Ok fine. I will try and create AudioQueueRef. I thought it is entirely different object. – Parth Bhatt Sep 14 '11 at 12:23

1 Answers1

6

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.

Community
  • 1
  • 1
DShah
  • 9,768
  • 11
  • 71
  • 127
  • Can you tell what `audioQueue` is? I think it is of type `AudioQueueRef` and I don't want to use AudioQueueRef Object. – Parth Bhatt Sep 26 '11 at 04:23