Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Audio Framework: stream, strategies, devices

Tags:

android

audio

I am trying to get a better understanding of android audio framework (froyo onwards in particular).

I've almost got the distinction into streams. The AudioFlinger maps each stream into a "strategy" and then routes a strategy to the proper "device" (BT, Headset, Speaker..)

However I still struggle to understand: 1) How multiple apps play onto the same stream? can they just 'play' or do they have to handle the focus (request, abandon and listen for changes)?

2) When multiple streams are playing...what is the priority of one stream respect to another? surely the in-call stream has top priority but are there any "rules" to understand how things really work.

If anyone with more confidence on this matter has got any doc/resource to study.. it would be great.

Thanks! Marco

like image 810
Marcovena Avatar asked Jan 19 '11 15:01

Marcovena


People also ask

What are audio attributes?

A class to encapsulate a collection of attributes describing information about an audio stream. AudioAttributes supersede the notion of stream types (see for instance AudioManager#STREAM_MUSIC or AudioManager#STREAM_ALARM ) for defining the behavior of audio playback.

How do I use multiple audio outputs on Android?

Android users need to go to Bluetooth Settings and pair either Bluetooth headphones or speakers one by one. Once connected, tap the three-dot icon on the right and click on Advanced Settings. Toggle on the 'dual audio' option if not already turned on. This should enable users to connect to two devices at once.

What is Android audio framework?

Android's audio Hardware Abstraction Layer (HAL) connects the higher-level, audio-specific framework APIs in android. media to the underlying audio drivers and hardware. The Audio HAL defines the standard interface that audio services call into. It must be implemented for the audio hardware to function correctly.

What is AudioFlinger Android?

AudioFlinger. We know that AudioFlinger (Sometimes called AF) is the core of the entire audio system in Android. It is a system service which starts during boot and enables the platform for audio related use-cases in the following ways. 1. Provide the access interface for the upper layer for using Audio.


1 Answers

The answer to this question

Concurrent Sound on Android Device

may help you.

Also, here

http://www.droidnova.com/creating-sound-effects-in-android-part-1,570.html

is written how to initialize the SoundManager with the number of concurrent streams you want to play.

like image 184
dajood Avatar answered Oct 14 '22 14:10

dajood