SlideShare a Scribd company logo
Android Audio with OpenSL Yossi Cohen DSP-IP
Overview Android Audio APIs OpenSL Overview OpenSL Android implementation (code)
Playing Audio on Android MediaPlayer SoundPool AudioTrack / AudioRecord (OpenMAX) OpenSL
MediaPlayer Java Based, Rich API Good for playing files and streams Not Good for gaming sounds or audio conferencing duo to very large delay
OpenMAX OpenMAX, a Khronos multimedia integration API exposes AudioTrack() and AudioRecord() Those functions enables the creation of “channels” which play or capture audio Those API enables audio effects like reverb or distortion This API also has a significant delay
OPENSL | ES Overview
OpenSL OpenSL is a Khronos Open Sound Library OpenSL ES is OpenSL for embedded systems Android 2.3 provides PARTIAL implementation of the OpenSL ES More on the limitations of And More on the OpenSL ES functions supported by Android  in this Article
OpenSL Advantages Enables Low level audio tweaking and control Device independent between android phone (Android 2.3+) Disadvantages Doesn’t improve the long audio delay of android phones
OpenSL Features OpenSL supports the following features Android OpenSL Implementation does not support most of those features Doppler MIDI messages Preset Reverb Equalizer Pitch Volume Buffer Queues Rate Metadata extraction Environmental Reverb Virtualization Stereo widening LED & Vibra 3D positioning
Android and OpenSL Open SL OpenSL ES Android OpenSL ES
OpenSL, OpenMAX and Android Base on Android logging we noticed that OpenSL calls ALSA and OpenMAX API functions Applications Media silicon (audio HW, CPUs, DSPs) OpenMax (AudioTrack / AudioRecord) ALSA
Profiles OpenSL has three profiles:  Phone Music  Game  Phone Basic mobile phones Ring tone and alert tone playback (basic MIDI functionality), basic audio playback and record functionality, simple 2D audio games Game-centric mobile devices Advanced MIDI functionality, sophisticated audio capabilities such as 3D audio, audio effects, ability to handle buffers of audio, etc. Music-centric mobile devices High quality audio, ability to support multiple music audio codecs,  audio streaming support Game Music
OpenSL API and Architecture OpenSL is a C API which implements a COM like API  Each object must implements the  SLObjectItf  Interface (like Iunknown in COM) OpenSL is NOT a discrete component architecture like Directshow or OpenMax IL OpenSL is not a channel like architecture like OpenMAX AL
OpenSL Objects After creation, object should be realized in order to use them.
OpenSL Architecture OpenSL uses a few objects Engine – a singleton object which must be implemented so we could use OpenSL  AudioPlayer – enables audio playing OutputMixer – enable mixing and audio effects (such as reverb)  AudioRecorder – enable audio capturing from microphone. Since Android does NOT support OpenSL microphone enumeration & control functions so AudioRecorder is the only way to capture audio in OpenSL
CODING OPENSL IN ANDROID
Android OpenSL Sample To use the sample, you should install the Android NDK.  Download Android NDK from  http://developer.android.com/sdk/ndk/index.html  no need to install just unzip The samples is under: Android-ndk-r5b/Samples/native-audio
Editing the project Select “Create new project” in eclipse select “android project” and follow the settings according to the screen capture:
Native Audio Overview Native Audio is a very simple (too simple) OpenSL sample. It enables Half duplex utilization of the OpenSL, this enables either capturing a SINGLE 5 second buffer or playing of  a single buffer. What is missing? Most voice applications will require Full Duplex behevior. The best sample for that is to create a loopback from Microphone to speakers.
Loopback sample For RT loopback behavior we need to add: Small buffers instead of 5 seconds buffers A two threaded application one for capture and one for record Since this presentation is not about how to build native application on Android we will not create such app from scratch but use an existing one, HelloJNI Import it from samples as we did for Native-Audio
Building an OpenSL application Add the following include files: #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> Add to the makefile LOCAL_LDLIBS  += -lOpenSLES
Add Audio Premissions Add the following user permissions for Audio capture and play in the Manifest permission tab: Internet is required for sending / receiving the audio packets
Application thread We will implement the recorder in the application thread. Recorder is create from the objects in the diagram, each object is created() and Realized()
Code Example – Create Engine // create engine __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;initEngine&quot;);   SLEngineOption EngineOption[] = {(SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE}; result = slCreateEngine( &engineObject, 1, EngineOption, 0, NULL, NULL); __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;create engine result %d&quot;, result); assert(SL_RESULT_SUCCESS == result); // realize the engine result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); assert(SL_RESULT_SUCCESS == result); // get the engine interface, which is needed in order to create other objects result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine); assert(SL_RESULT_SUCCESS == result); __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;get engine result %d&quot;, result);
Play Thread creation result = pthread_create( &audioThread, NULL, AudioInOutThread,  NULL); After creating the recorder like in the native-Audio sample we will create the player thread void *AudioInOutThread( void *ptr ) { SLresult result; initPlayer(); // set the player's state to playing result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_PLAYING); assert(SL_RESULT_SUCCESS == result); }
Player CallBack Function void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { int playershift = playFrame*RECORDER_FRAME;  SLresult result; // enqueue another buffer result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, &recorderBuffer[playershift++], RECORDER_FRAME*sizeof(short)); } We will enqueue the next sample in the callback (need to verify there is a next sample) Recorder Enqueue is the same but also preform the first enqueue for the player to start it
Player Thread The player implements the following objects
Resources WiseAndroid Blog Mobile Pearls Blog MindTheRobot Blog
DSP-IP Contact information Download slides at:  www.dsp-ip.com For course & Development consulting contact www.dsp-ip.com   Mail  :  [email_address]   Phone:  +972-545-313092 Fax  :  +972-50- 8962910 Yossi Cohen [email_address]   +972-545-313092

More Related Content

PDF
Unity2018/2019における最適化事情
PPTX
Unreal animation system
PPTX
Built for performance: the UIElements Renderer – Unite Copenhagen 2019
PDF
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
PDF
강좌 02 ARM 펌웨어 개발 환경 개요
PDF
そう、UE4ならね。あなたのモバイルゲームをより快適にする沢山の冴えたやり方について Part 2 <Texture Streaming, メモリプロ...
PDF
無線LANデバイスについて(kernelレベル)
PDF
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013
Unity2018/2019における最適化事情
Unreal animation system
Built for performance: the UIElements Renderer – Unite Copenhagen 2019
Ndc2014 시즌 2 : 멀티쓰레드 프로그래밍이 왜 이리 힘드나요? (Lock-free에서 Transactional Memory까지)
강좌 02 ARM 펌웨어 개발 환경 개요
そう、UE4ならね。あなたのモバイルゲームをより快適にする沢山の冴えたやり方について Part 2 <Texture Streaming, メモリプロ...
無線LANデバイスについて(kernelレベル)
게임에서 흔히 쓰이는 최적화 전략 by 엄윤섭 @ 지스타 컨퍼런스 2013

What's hot (20)

PPTX
Siggraph 2016 - Vulkan and nvidia : the essentials
PDF
中級グラフィックス入門~シャドウマッピング総まとめ~
PDF
【CEDEC2017】Unityを使ったNintendo Switch™向けのタイトル開発・移植テクニック!!
PDF
超連射68K 開発日記 -弾幕世代以前の90年代 STG のこと-
PDF
강좌 03 개발환경 구축
PDF
KLabのゲーム開発を支える開発環境
PDF
Making Linux do Hard Real-time
PDF
NDC2017 언리얼엔진4 디버깅 101 - 게임 기획자, 프로그래머가 버그와 만났을 때 사용할 수 있는 지침들
PDF
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
PDF
Unityネイティブプラグインの勧め
PPTX
UI아트 작업자를 위한 언리얼엔진4 UMG #1
PDF
Making Linux do Hard Real-time
PDF
AirLab導入でテストコストの大幅削減と品質向上! 数十台の端末を一斉に全自動テストできる社内DeviceFarmについてご紹介
PDF
開発もQAも自動テスト!「LOST JUDGMENT:裁かれざる記憶」のQAテスター参加で進化した「テスト自動化チーム(仮)」の取り組みについて
PDF
ヤフー発のメッセージキュー「Pulsar」のご紹介
PPTX
Ansible ではじめるインフラのコード化入門
PDF
나만의 엔진 개발하기
PDF
UE4 Garbage Collection
PDF
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
PDF
衝突判定
Siggraph 2016 - Vulkan and nvidia : the essentials
中級グラフィックス入門~シャドウマッピング総まとめ~
【CEDEC2017】Unityを使ったNintendo Switch™向けのタイトル開発・移植テクニック!!
超連射68K 開発日記 -弾幕世代以前の90年代 STG のこと-
강좌 03 개발환경 구축
KLabのゲーム開発を支える開発環境
Making Linux do Hard Real-time
NDC2017 언리얼엔진4 디버깅 101 - 게임 기획자, 프로그래머가 버그와 만났을 때 사용할 수 있는 지침들
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Unityネイティブプラグインの勧め
UI아트 작업자를 위한 언리얼엔진4 UMG #1
Making Linux do Hard Real-time
AirLab導入でテストコストの大幅削減と品質向上! 数十台の端末を一斉に全自動テストできる社内DeviceFarmについてご紹介
開発もQAも自動テスト!「LOST JUDGMENT:裁かれざる記憶」のQAテスター参加で進化した「テスト自動化チーム(仮)」の取り組みについて
ヤフー発のメッセージキュー「Pulsar」のご紹介
Ansible ではじめるインフラのコード化入門
나만의 엔진 개발하기
UE4 Garbage Collection
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
衝突判定
Ad

Viewers also liked (20)

PPTX
Android audio system(audioflinger)
PPT
Android Audio System
PPTX
Android audio system(audioplicy_service)
PPTX
Android audio system(audio_hardwareinterace)
PDF
Android Tools for Qualcomm Snapdragon Processors
PDF
Android media framework overview
PDF
Superpowered Media Server for Android
PDF
Android's Multimedia Framework
PDF
Multimedia on android
PDF
Android Multimedia Framework
PDF
Wifi api android
PDF
Game Audio in Mobile Development
PDF
HH QUALCOMM ‘hear’ & now qualcomm® snapdragon™ audio
PDF
Android Camera
PPT
Problems and Solutions in Game Audio
PDF
Android Wi-Fi Manager and Bluetooth Connection
PDF
Lock free programming - pro tips devoxx uk
KEY
日本Androidの会発表スライド androidのメディア機能の話
PPTX
Camera camcorder framework overview(ginger bread)
PDF
OpenSL ES 1.1 Reference Card
Android audio system(audioflinger)
Android Audio System
Android audio system(audioplicy_service)
Android audio system(audio_hardwareinterace)
Android Tools for Qualcomm Snapdragon Processors
Android media framework overview
Superpowered Media Server for Android
Android's Multimedia Framework
Multimedia on android
Android Multimedia Framework
Wifi api android
Game Audio in Mobile Development
HH QUALCOMM ‘hear’ & now qualcomm® snapdragon™ audio
Android Camera
Problems and Solutions in Game Audio
Android Wi-Fi Manager and Bluetooth Connection
Lock free programming - pro tips devoxx uk
日本Androidの会発表スライド androidのメディア機能の話
Camera camcorder framework overview(ginger bread)
OpenSL ES 1.1 Reference Card
Ad

Similar to Android Audio & OpenSL (20)

PDF
Hacking Android OS
PDF
25329 (2).pdf
PPTX
Android Introduction on Java Forum Stuttgart 11
ODP
Plug yourself in and your app will never be the same (1 hr edition)
PPT
Creating Flash Content for Multiple Screens
ODP
Plug yourself in and your app will never be the same (2 hour edition)
ODP
Plug yourself in and your app will never be the same (2 hr editon)
PDF
UplinQ - enhance qualcomm® snapdragon™ audio using android audio ap_is
PPT
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
PDF
International Journal of Engineering Research and Development
PPTX
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
PPTX
Android
PDF
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, Greenrobot
PPT
Getting Started with Adobe AIR 1.5
PPT
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
PPT
GNAT GPL For Mindstorms
PPTX
Android os versions and architecture
PPTX
Android
PPT
Flash for Mobile Devices
PDF
Slides bootcamp21
Hacking Android OS
25329 (2).pdf
Android Introduction on Java Forum Stuttgart 11
Plug yourself in and your app will never be the same (1 hr edition)
Creating Flash Content for Multiple Screens
Plug yourself in and your app will never be the same (2 hour edition)
Plug yourself in and your app will never be the same (2 hr editon)
UplinQ - enhance qualcomm® snapdragon™ audio using android audio ap_is
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
International Journal of Engineering Research and Development
OWF12/PAUG Conf Days Alternative to google's android emulator, daniel fages, ...
Android
Droidcon 2011: Gingerbread and honeycomb, Markus Junginger, Greenrobot
Getting Started with Adobe AIR 1.5
Open Kode, Airplay And The New Reality Of Write Once Run Anywhere
GNAT GPL For Mindstorms
Android os versions and architecture
Android
Flash for Mobile Devices
Slides bootcamp21

More from Yoss Cohen (20)

PPTX
Underwater robotics simulation with isaac sim
PPTX
Infrared simulation and processing on Nvidia platforms
PPTX
open platform for swarm training
PDF
Deep Learning - system view
PDF
Dspip deep learning syllabus
PPT
IoT consideration selection
PPT
IoT evolution
DOC
Nvidia jetson nano bringup
PPT
Autonomous car teleportation architecture
PPT
Motion estimation overview
PPT
Computer Vision - Image Filters
PPT
Intro to machine learning with scikit learn
PPT
DASH and HTTP2.0
PPT
HEVC Definitions and high-level syntax
PPT
Introduction to HEVC
PPT
FFMPEG on android
PDF
Hands-on Video Course - "RAW Video"
PDF
Video quality testing
PPT
HEVC / H265 Hands-On course
PPT
Web video standards
Underwater robotics simulation with isaac sim
Infrared simulation and processing on Nvidia platforms
open platform for swarm training
Deep Learning - system view
Dspip deep learning syllabus
IoT consideration selection
IoT evolution
Nvidia jetson nano bringup
Autonomous car teleportation architecture
Motion estimation overview
Computer Vision - Image Filters
Intro to machine learning with scikit learn
DASH and HTTP2.0
HEVC Definitions and high-level syntax
Introduction to HEVC
FFMPEG on android
Hands-on Video Course - "RAW Video"
Video quality testing
HEVC / H265 Hands-On course
Web video standards

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
The AUB Centre for AI in Media Proposal.docx
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
sap open course for s4hana steps from ECC to s4
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding

Android Audio & OpenSL

  • 1. Android Audio with OpenSL Yossi Cohen DSP-IP
  • 2. Overview Android Audio APIs OpenSL Overview OpenSL Android implementation (code)
  • 3. Playing Audio on Android MediaPlayer SoundPool AudioTrack / AudioRecord (OpenMAX) OpenSL
  • 4. MediaPlayer Java Based, Rich API Good for playing files and streams Not Good for gaming sounds or audio conferencing duo to very large delay
  • 5. OpenMAX OpenMAX, a Khronos multimedia integration API exposes AudioTrack() and AudioRecord() Those functions enables the creation of “channels” which play or capture audio Those API enables audio effects like reverb or distortion This API also has a significant delay
  • 6. OPENSL | ES Overview
  • 7. OpenSL OpenSL is a Khronos Open Sound Library OpenSL ES is OpenSL for embedded systems Android 2.3 provides PARTIAL implementation of the OpenSL ES More on the limitations of And More on the OpenSL ES functions supported by Android in this Article
  • 8. OpenSL Advantages Enables Low level audio tweaking and control Device independent between android phone (Android 2.3+) Disadvantages Doesn’t improve the long audio delay of android phones
  • 9. OpenSL Features OpenSL supports the following features Android OpenSL Implementation does not support most of those features Doppler MIDI messages Preset Reverb Equalizer Pitch Volume Buffer Queues Rate Metadata extraction Environmental Reverb Virtualization Stereo widening LED & Vibra 3D positioning
  • 10. Android and OpenSL Open SL OpenSL ES Android OpenSL ES
  • 11. OpenSL, OpenMAX and Android Base on Android logging we noticed that OpenSL calls ALSA and OpenMAX API functions Applications Media silicon (audio HW, CPUs, DSPs) OpenMax (AudioTrack / AudioRecord) ALSA
  • 12. Profiles OpenSL has three profiles: Phone Music Game Phone Basic mobile phones Ring tone and alert tone playback (basic MIDI functionality), basic audio playback and record functionality, simple 2D audio games Game-centric mobile devices Advanced MIDI functionality, sophisticated audio capabilities such as 3D audio, audio effects, ability to handle buffers of audio, etc. Music-centric mobile devices High quality audio, ability to support multiple music audio codecs, audio streaming support Game Music
  • 13. OpenSL API and Architecture OpenSL is a C API which implements a COM like API Each object must implements the SLObjectItf Interface (like Iunknown in COM) OpenSL is NOT a discrete component architecture like Directshow or OpenMax IL OpenSL is not a channel like architecture like OpenMAX AL
  • 14. OpenSL Objects After creation, object should be realized in order to use them.
  • 15. OpenSL Architecture OpenSL uses a few objects Engine – a singleton object which must be implemented so we could use OpenSL AudioPlayer – enables audio playing OutputMixer – enable mixing and audio effects (such as reverb) AudioRecorder – enable audio capturing from microphone. Since Android does NOT support OpenSL microphone enumeration & control functions so AudioRecorder is the only way to capture audio in OpenSL
  • 16. CODING OPENSL IN ANDROID
  • 17. Android OpenSL Sample To use the sample, you should install the Android NDK. Download Android NDK from http://developer.android.com/sdk/ndk/index.html no need to install just unzip The samples is under: Android-ndk-r5b/Samples/native-audio
  • 18. Editing the project Select “Create new project” in eclipse select “android project” and follow the settings according to the screen capture:
  • 19. Native Audio Overview Native Audio is a very simple (too simple) OpenSL sample. It enables Half duplex utilization of the OpenSL, this enables either capturing a SINGLE 5 second buffer or playing of a single buffer. What is missing? Most voice applications will require Full Duplex behevior. The best sample for that is to create a loopback from Microphone to speakers.
  • 20. Loopback sample For RT loopback behavior we need to add: Small buffers instead of 5 seconds buffers A two threaded application one for capture and one for record Since this presentation is not about how to build native application on Android we will not create such app from scratch but use an existing one, HelloJNI Import it from samples as we did for Native-Audio
  • 21. Building an OpenSL application Add the following include files: #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> Add to the makefile LOCAL_LDLIBS += -lOpenSLES
  • 22. Add Audio Premissions Add the following user permissions for Audio capture and play in the Manifest permission tab: Internet is required for sending / receiving the audio packets
  • 23. Application thread We will implement the recorder in the application thread. Recorder is create from the objects in the diagram, each object is created() and Realized()
  • 24. Code Example – Create Engine // create engine __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;initEngine&quot;);   SLEngineOption EngineOption[] = {(SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE}; result = slCreateEngine( &engineObject, 1, EngineOption, 0, NULL, NULL); __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;create engine result %d&quot;, result); assert(SL_RESULT_SUCCESS == result); // realize the engine result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); assert(SL_RESULT_SUCCESS == result); // get the engine interface, which is needed in order to create other objects result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine); assert(SL_RESULT_SUCCESS == result); __android_log_print(ANDROID_LOG_INFO, &quot;NativeAudio&quot;, &quot;get engine result %d&quot;, result);
  • 25. Play Thread creation result = pthread_create( &audioThread, NULL, AudioInOutThread, NULL); After creating the recorder like in the native-Audio sample we will create the player thread void *AudioInOutThread( void *ptr ) { SLresult result; initPlayer(); // set the player's state to playing result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_PLAYING); assert(SL_RESULT_SUCCESS == result); }
  • 26. Player CallBack Function void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { int playershift = playFrame*RECORDER_FRAME; SLresult result; // enqueue another buffer result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, &recorderBuffer[playershift++], RECORDER_FRAME*sizeof(short)); } We will enqueue the next sample in the callback (need to verify there is a next sample) Recorder Enqueue is the same but also preform the first enqueue for the player to start it
  • 27. Player Thread The player implements the following objects
  • 28. Resources WiseAndroid Blog Mobile Pearls Blog MindTheRobot Blog
  • 29. DSP-IP Contact information Download slides at: www.dsp-ip.com For course & Development consulting contact www.dsp-ip.com Mail : [email_address] Phone: +972-545-313092 Fax : +972-50- 8962910 Yossi Cohen [email_address] +972-545-313092