Commit Graph

9 Commits

Author SHA1 Message Date
Scott Shawcroft 76008ce304
Introduce audioio.Mixer which can mix multiple audio samples
to produce a single sample.

Only works with 16 bit samples on the M4.

Fixes #987
2018-10-05 15:12:23 -07:00
Scott Shawcroft de5a9d72dc
Compress all translated strings with Huffman coding.
This saves code space in builds which use link-time optimization.
The optimization drops the untranslated strings and replaces them
with a compressed_string_t struct. It can then be decompressed to
a c string.

Builds without LTO work as well but include both untranslated
strings and compressed strings.

This work could be expanded to include QSTRs and loaded strings if
a compress method is added to C. Its tracked in #531.
2018-08-16 17:40:57 -07:00
Scott Shawcroft a5e03b76a6 Split out the peripherals library in preparation of sharing with MakeCode. 2018-06-15 16:16:21 -07:00
Dan Halbert e724bc1c4e Fix playing audio from SD card 2018-06-14 18:47:40 -04:00
Scott Shawcroft fd71e56891 atmel-samd: Re-org helper peripheral files into their own subdirectory.
Ideally in the future they won't depend on ASF4 or MicroPython.
2018-06-01 15:07:31 -07:00
Scott Shawcroft 50fc90bc5f Add pause/resume control to AudioOut and I2SOut
Fixes #808
2018-05-08 11:53:13 -07:00
Scott Shawcroft 22b7cd3d51 Fix 8 bit recordings on CPX.
The DMA trigger source was incorrect when using serializer 1 on
the SAMD21.

Playback register was incorrect for 8 bit as well. Now fixed.
2018-05-02 15:15:25 -07:00
Scott Shawcroft cfea51ec68 Re-enable PDMIn without ASF and using the helpers added with
I2SOut.

The API is almost the same except the frequency attribute has been
renamed to sample_rate so that its less likely to be confused with
frequencies within the audio itself.

Fixes #263.
2018-05-01 14:35:43 -07:00
Scott Shawcroft 28642ab10d Add audio output support!
This evolves the API from 2.x (and breaks it). Playback devices are now
separate from the samples themselves. This allows for greater playback
flexibility. Two sample sources are audioio.RawSample and audioio.WaveFile.
They can both be mono or stereo. They can be output to audioio.AudioOut or
audiobusio.I2SOut.

Internally, the dma tracking has changed from a TC counting block transfers
to an interrupt generated by the block event sent to the EVSYS. This reduces
the overhead of each DMA transfer so multiple can occure without using up TCs.

Fixes #652. Fixes #522. Huge progress on #263
2018-04-12 16:35:13 -07:00