【Android Audio】Audio: summery of making a call

When making a voip call with BT ,the sound of maker would berecorded into the phone and send to the receiver, at the same time,the sound of receiver would come from the BT.

That is to say, we could divide the whole progress intorecording and tracking.

Recording and tracking are the progress of opposite, thefollowing sequence diagram is tracking, to see audio record sequencediagram,  we only need to change output to Input ,AudioTrack to AudioRecord and TrackHandler toRecordHandler.


The number descript as belw,

1,after request audio focus, it can record or track,

6,7,8,at these steps, it can check routing, device etc.,like checking and setting BT or earpiece is used, the callstate and the callis a voip call or a real call,

10, openOutput to AudioFlinger would cause AudioFlingerto create work thread like MixerThread,

11,open output stream, in_read or out_write inaudio_hw.c,

12,get mixer thread for audio track, actually, I thinkthe record thread don’t need this step,

13,add the next audio thread into playback thread,

14,return the next audio track thread id with deviceinfo,

15,according to the receiving thread id, AudioTrack wouldcall method creatTrack(),and AudioFlinger would create the track in the giventhread id,

16,there are two more steps before this, PlaybackThread*thread = checkPlaybackThread_I (output), mClients.add(pid,client),AudioTrackand AudioRecord progress are AudioFlinger’s client, and all client progress ismarked by progress pid,

17,18, AudioHandle is server side of the client'sIAudioTrack, at the same time, RecordHande is to IAudioRecord, TrackHandlerextends BnAudioTrack and RecordHandle extends BnAudioRecord they are based onBinder communication,

19,AudioTrack would send the audio data to the upperthread,and the thread finally write data into shared memory.




another picture of audio track sequence


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值