Question

My app performs recording and playing sound. Because of some recording algorithms, I used a library for recording. About playing, I use AVAudioPlayer to play file.

The problem is: It's seem the library has it's own volume control.

(1). Before the library is active (it's mean the library is inactive), I change the volume by iPhone's hard buttons (+ and -) to low volume

enter image description here

(2). Then, when the library is active, I change the volume to higher volume.

enter image description here

(3). Then, when the library is inactive again, the volume automatically changes back to low volume.

enter image description here

From now: If the library is active, the volume is as (2); if the library is inactive, the volume is as (3).

I read more about AVAudioSession and AudioToolbox but see any point about volume. Can you point me the mechanism here, so I can resolve my problem.

Sorry about the image, I just create a demo to show my problem, it's not my app UI, because of security.

Thank you all!

Was it helpful?

Solution

I found the problem.

These are volume for 2 different audio routes:

  • one is speaker next to microphone, on bottom.

  • one is receiver - the speaker for phone call, next to front camera, on top.

My app use speaker, but the library use the receiver.

Thanks for you time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top