Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
db13d3c1
Unverified
Commit
db13d3c1
authored
Jun 09, 2024
by
Earle F. Philhower, III
Committed by
GitHub
Jun 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic A2DP BluetoothAudio documentation (#2217)
parent
f8c1ec10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
docs/a2dp.rst
docs/a2dp.rst
+39
-0
docs/index.rst
docs/index.rst
+1
-0
No files found.
docs/a2dp.rst
0 → 100644
View file @
db13d3c1
Bluetooth Audio (A2DP Source and Sink)
======================================
The PicoW can be used as a Bluetooth Audio sink or source with the ``BluetoothAudio`` class.
Operation is generally handled "automatically" in the background so while the audio is
playing or streaming the main application can perform other operations (like displaying
playback info, polling buttons for controls, etc.)
.. code :: cpp
#include <BluetoothAudio.h>
...
**Note about CPU usage:** Bluetooth SBC audio is a compressed format. That means
that it takes non-trivial amounts of CPU to compress on send, or decompress on receive.
Transmitting precompressed audio from, say, MP3 or AAC, requires first decompressing
the source file into raw PCM and then re-compressing them in the SBC format. You may
want to consider overclocking in this case to avoid underflow.
A2DPSink
--------
This class implements slave sink-mode operation with player control (play, pause, etc.) and
can play the received and decoded SBC audio to ``PWMAudio``, ``I2S``, or a user-created
`BluetoothAudioConsumer`` class.
The ``A2DPSink.ino`` example demonstrates turning a PicoW into a Bluetooth headset with
``PWMAudio``.
A2DPSource
-----------
This class implements a master source-mode SBC Bluetooth A2DP audio connection which
transmits audio using the standard ``Stream`` interface (like ``I2S`` or ``PWMAudio``.
The main application connects to a Bluetooth speaker and then writes samples into a buffer
that's automatically transmitted behind the scenes.
The ``A2DPSource.ino`` example shows how to connect to a Bluetooth speaker, transmit
data, and respond to commands from the speaker.
docs/index.rst
View file @
db13d3c1
...
...
@@ -46,6 +46,7 @@ For the latest version, always check https://github.com/earlephilhower/arduino-p
Bluetooth <bluetooth>
Bluetooth HID Master <hidmaster>
Bluetooth Audio (A2DP) <a2dp>
Single File USB Drive <singlefile>
FatFSUSB - full FS access over USB <fatfsusb>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment