iOS Question [SOLVED?] Equivalent of B4A Phone/SetVolume/GetVolume/VOLUME_MUSIC

JackKirk

Well-Known Member
Licensed User
Longtime User
I have just recently completed my first B4A app and am now looking at porting it to B4I.

My B4A app uses the TTS library to provide voice prompts at certain points in the user interaction. It would appear that I can use iPhone.TTS in B4I to replicate this functionality.

When issuing voice prompts the B4A app also overrides any manual volume settings of the media voice channel via Phone/SetVolume/GetVolume/VOLUME_MUSIC.

There does not appear to be any ability to get/set volume anywhere in B4I except in the Media Player library which I'm assuming isn't related to TTS - or is it?

So my question is - is there any way to get and set the volume of the channel(?) used by TTS in B4I?

Thanks in anticipation...
 

JanPRO

Well-Known Member
Licensed User
Longtime User
There is a volume property in iOS, but it wasn't wrapped yet. You also can't get access to the property via NativeObject, because the volume property is part of AVSpeechUtterance and TTS is a part of the AVSpeechSynthesizer. For now you can use inline Objective-C code ...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
JanPRO,

Thanks for your prompt response but unfortunately I know absolutely nothing about inline Objective-C.

Can you or anyone else be much more explicit?

Actually totally explicit would be better.

Thanks in anticipation again...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
It is not possible to programmatically change the system volume in iOS.

There is a configurable volume property specific to AVSpeechUtterance. The default value is 1.0 which is the maximum level.
I have 2 volume control solutions:

(1) "General audio" - music, TTS etc:


(2) "Ringer" or "ringtones/alerts" - incoming phone call, SMS arrivals, other notifications AND pseudo camera shutter sound:

Regards...
 
Last edited:
Upvote 0

Similar Threads

Replies
9
Views
1K
D
  • Question
Replies
5
Views
2K
Top