<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42875/any-adpcm-opus-example-available</link><description>Hi, guys! I noticed this answer from the devzone . 
 
 I have nRF52 DK and an nRF Thingy. I want to play a short speech using I2S with MAX98357A . 
 This speech is usually has a length of 5~20 seconds. 
 This doesn&amp;#39;t need to be played in strict real time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Feb 2019 08:10:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42875/any-adpcm-opus-example-available" /><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/171292?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 08:10:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:653c6868-3eac-4574-8846-df5242989702</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;1. The linker is complaining that the binary is too large for your Keil license. The SR3 firmware is quite large, so there is no way it can be built with the free Keil license (32 kB limitation).&lt;/p&gt;
&lt;p&gt;2. The SR3 firmware&amp;nbsp;use a modified SDK, so there are some differences.&amp;nbsp;The latest is based on SDK 14.2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/171283?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 07:12:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f5d05a5-5c59-4a87-8f0f-653d8599c5e3</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thanks, Einar. Before closing this thread, may I add 2 questions, please?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just installed the EXE file you&amp;#39;ve mentioned.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0066.error.png" /&gt;&lt;/p&gt;
&lt;p&gt;1. Error Message&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;63519-SR3_nRF52832_Shield.axf: error: L6050U&lt;/pre&gt; has appeared.I never saw something like this; can you help me to solve this, please?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Is this Firmware example use the same nRF52 SDK 15.2 as well or it is a different SDK?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Thanks!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/171047?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 09:10:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23346ab0-523f-4d54-8b04-07d51dffe374</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to download the &amp;quot;Desktop Software&amp;quot; file. Then extract it on a windows computer, and run the installer (nRFready Smart Remote 3 nRF52 v121alpha.exe). Then you will get the firmware installed under&amp;nbsp;C:\Nordic Semiconductor\nRFready Smart Remote 3 nRF52 v1.2.1alpha unless you select a different location. You can always copy that folder and move the source code to the mac of another machine without running the installer again.&lt;/p&gt;
&lt;p&gt;You will find the Smart remote projects under&amp;nbsp;nRF5x SDK-SR3\examples\ble_peripheral\smart_remote_3_nrf52\Projects\. Note that there is no SES project, but there are projects for keil. In any case this is the full SR3 reference design, so you will probably want to use it for inspiration and extract what you need rather than using the provided projects. Unfortunately, that is up to you, as we do not provide any other examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/170971?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 17:52:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad0b5992-064f-4caf-94a6-dceaea5a3c01</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Hello, Einar.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/42875/any-adpcm-opus-example-available/170800"]The firmware implementation is available &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Reference-Designs/nRFready-Smart-Remote-3-for-nRF52-Series/Download#infotabs"&gt;here&lt;/a&gt;&amp;nbsp;(just download the zip, unzip it and run the installer on a windows computer. [/quote]
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screen-Shot-2019_2D00_02_2D00_13-at-11.45.28-AM.png" /&gt;&lt;/p&gt;
&lt;p&gt;Are you mentioning about the &amp;quot;nRF6939-FW&amp;quot;? I&amp;#39;m using a MacBook (OS version&amp;nbsp;10.14.3) and a Windows 10 laptop, by the way.&lt;/p&gt;
&lt;p&gt;I was expecting typical SEGGER ES projects or Keil Projects and C source files, I noticed 2 files; binaries &amp;amp; sources.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/42875/any-adpcm-opus-example-available/170800"]To look at the audio implementation you can start in the m_audio.c file and see how the audio input system is implemented, using I2S and Opus (optionally).[/quote]
&lt;p&gt;Then, do I need to type, from the amd64 directory,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;$ sudo dpkg -i *.deb&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;on my MacBook to see the &amp;quot;m_audio.c&amp;quot; file?&lt;/p&gt;
&lt;p&gt;How can I install this on Windows 10, then?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Thanks for your help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/170800?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 09:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20eef4ab-fc11-4117-a917-2492b8ae7c12</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The Smart Remote reference design has most of what you ask for: A example which use Opus and &lt;a href="https://www.nordicsemi.com/DocLib/Content/User_Guides/sr3_nrf52/latest/UG/sr3_nrf52/hw_descr_add_on/digital_mic"&gt;I2S microphones&lt;/a&gt;. It is for the nRF52832, but it is equally valid for the nRF52840. Unfortunately we do not have any example in the SDK itself, nor an example which is intended for the nRF52840 DK, but you should be able to use the Smart Remote implementation as a reference.&lt;/p&gt;
&lt;p&gt;You can see the &lt;a href="https://www.nordicsemi.com/DocLib/Content/User_Guides/sr3_nrf52/latest/UG/sr3_nrf52/intro/frontpage"&gt;documentation for the SR3 her.&lt;/a&gt;&amp;nbsp;The firmware implementation is available &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Reference-Designs/nRFready-Smart-Remote-3-for-nRF52-Series/Download#infotabs"&gt;here&lt;/a&gt;&amp;nbsp;(just download the zip, unzip it and run the installer on a windows computer. To look at the audio implementation you can start in the m_audio.c file and see how the audio input system is implemented, using I2S and Opus (optionally). Unfortunately it is quite complex as it is part of a full smart remote control reference design, but it is the only such example we provide.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/170733?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 22:54:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b009765-7aa4-456d-bced-460ec0409e8c</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Hello, Einar. I&amp;nbsp;want to see an OPUS example which uses I2S and the nRF52840 DK.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m currently using Keil MDK 5 and SEGGER ES 3.&amp;nbsp;Can I get an example C code of this?&lt;/p&gt;
&lt;p&gt;The Smart Remote 3 firmware (nRF6939-FW) has multiple TGZ files and I cannot find anything related to OPUS.&lt;/p&gt;
&lt;p&gt;As a result, I wish to get an example C code which uses OPUS with I2S.&lt;/p&gt;
&lt;p&gt;It will be great if that example can be compiled using Keil or SEGGER ES.&lt;/p&gt;
&lt;p&gt;Will this be available?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/170577?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 10:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4d74322-0254-431a-a23e-3c5f0fc2719a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/matthewkyeo"&gt;Matthew K&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;You have gotten excellent answers from &lt;a href="https://devzone.nordicsemi.com/members/wpaul"&gt;wpaul&lt;/a&gt;, so there is not much to add. I did not fully understand what you would like a comment on from Nordic, but what I can say is that we have some reference designs using both ADPCM and OPUS, which you can refer to. The &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Reference-Designs/nRFready-Smart-Remote-3-for-nRF52-Series"&gt;nRFready Smart Remote 3 for nRF52 Series&lt;/a&gt;&amp;nbsp;support&amp;nbsp;both, and the Thingy:52 firmware use ADPCM. In both cases it is used to compress microphone data.&lt;/p&gt;
&lt;p&gt;Please let me know if you have more specific questions you want me to comment on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/169168?ContentTypeID=1</link><pubDate>Sat, 02 Feb 2019 23:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf085bcf-2c0a-489c-990b-05421b2b08d6</guid><dc:creator>wpaul</dc:creator><description>&lt;p&gt;When you say &amp;quot;external stereo&amp;quot; you mean what amplifier, right? I think we settled on the Texas Instruments LM4880. We&amp;#39;re making a small board, so we&amp;#39;re trying to use small speakers (Dayton Audio CM20-14M-8).&lt;/p&gt;
&lt;p&gt;Unfortunately we&amp;#39;re probably going to have to get a prototype board fabricated for testing rather than breadboard the amplifier since most parts are SMT only.&lt;/p&gt;
&lt;p&gt;Right now for my test setup, I have the CS4344 breakout board stuffed into one of the headers on the nRF52840 DK board, and I have my computer speakers plugged into the jack so I can hear properly. It&amp;#39;s messy, but at least I can tell that I&amp;#39;ve got my IS2 code working right.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/169167?ContentTypeID=1</link><pubDate>Sat, 02 Feb 2019 23:44:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:705067da-1728-453b-824c-8e0087735e3f</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;&lt;span class="mceItem mceNonEditable mceQuote" id="mceQuote1"&gt;...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now I remember. I saw CS4344 on STM32 Disco boards.&lt;/p&gt;
&lt;p&gt;If it is fine to reveal it, can I ask what external stereo you will use?&lt;/p&gt;
[quote userid="75667" url="~/f/nordic-q-a/42875/any-adpcm-opus-example-available/167268"] while the MAX98357A is monaural, it has a built-in amplifier. [/quote]
&lt;p&gt;For my case, I will only use one 3W speaker for the prototype. In this case, I won&amp;#39;t need a stereo codec like you, right?&lt;/p&gt;
&lt;p&gt;Or do you have any recommendation for alternative I2S amps to play songs which can be mounted on breadboards?&amp;nbsp;MAX98357A was the only I could find from online.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m waiting for the Nordic team&amp;#39;s reply about&amp;nbsp;ADPCM / Opus. Thanks for helping me while waiting for their answer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/167268?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 07:12:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaf80c8b-70cd-46f3-a6d7-0b7dba74eb21</guid><dc:creator>wpaul</dc:creator><description>&lt;p&gt;Look at the I2S section of the nRF52840 product specification document. You need to configure two things: the MCLK frequency, and the left/right clock (LRCLK) divisor, which yields the LRCLK frequency. Typically both the MCLK and LRCLK must be supplied to the I2S codec chip. (It looks like the MAX98357A doesn&amp;#39;t need MCLK, but the CS4344 does.) Nordic does not let you choose arbitrary values for these things: you get to choose from a specific set of MCLK and LRCLK settings. There&amp;#39;s some tables which show you some possible values. I chose values that yielded 15.625KHz for the LRCLK:&lt;/p&gt;
&lt;p&gt;MCLK == 32MHz divided by 8 == 4MHz&lt;/p&gt;
&lt;p&gt;LRCLK divisor == 256&lt;/p&gt;
&lt;p&gt;4000000 / 256 == 15625&lt;/p&gt;
&lt;p&gt;This effectively also sets the audio sample rate, so when you encode your audio samples, you have to do it at this same rate in order for them to play correctly.&lt;/p&gt;
&lt;p&gt;You can choose different values for a higher sample rate -- the higher the sample rate, the higher the maximum audio frequency you can sample. The max audio frequency is usually half the sample rate, so with 15.625KHz sample rate, the audio frequency range is 7812.5Hz. This is more than good enough for voice and &amp;#39;ok&amp;#39; for music, though for music content you usually want 20KHz as the top end frequency. This is why 44.1KHz is used for sampling high quality audio (44.1KHz is basically two times 20KHz).&lt;/p&gt;
&lt;p&gt;A higher sample rate means you end up with more samples per second though so you end up with bigger files. I chose 15.625KHz as a good compromise between audio quality and file size for my application.&lt;/p&gt;
&lt;p&gt;The reason I used the CS4344 is because it&amp;#39;s a stereo codec (it has two audio outputs, for left and right channel). However while the MAX98357A is monaural, it has a built-in amplifier. (My friend and I are planning to use an external stereo amplifier with the CS4344.) The I2S controller in the nRF52 supports both mono and stereo modes. With stereo, you have twice the audio samples, interleaved. The first sample is for the left channel and the second is for the right. The left and right channels are automatically routed to the right output of the codec chip by the hardware.&lt;/p&gt;
&lt;p&gt;You can see the sample driver code that I wrote here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/netik/dc27_badge/blob/master/software/firmware/badge_840/i2s_lld.c"&gt;https://github.com/netik/dc27_badge/blob/master/software/firmware/badge_840/i2s_lld.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used a couple of dirty tricks to make it work the way I wanted for my application, but it basically follows the same setup steps as documented in the nRF52840 manual.&lt;/p&gt;
&lt;p&gt;The nRF52840 doesn&amp;#39;t have any hardware tricks in it for handling ADPCM (as far as I know) so any work Nordic would do here would likely involve porting an ADPCM decoder library so that it builds with the SDK. ADPCM is probably simpler to implement than Opus meaning it would require less processing overhead, but I think Opus gives you better compression.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/167264?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 06:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcb9c94b-cdc2-47c8-acc2-f3e7227deab3</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thanks for your kind reply!&lt;/p&gt;
&lt;p&gt;0) I apologize for my ignorance in audio;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2^16 = 65,536, 2^15 = 32,768, but where did the15625 came from?&lt;/p&gt;
&lt;p&gt;1) You&amp;rsquo;ve mentioned bout CS4344 to hear the sound.&lt;/p&gt;
&lt;p&gt;Does this mean when I use MAX98357A, this cannot make a sound like CS4344?&lt;/p&gt;
&lt;p&gt;What is the key feature that CS4344 has compared to other products?&lt;/p&gt;
&lt;p&gt;Thanks a million.&lt;/p&gt;
&lt;p&gt;I did hear that the Nordic team is focusing on ADPCM on the other post so I was curious what will the Nordic team will answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Any ADPCM / Opus example available?</title><link>https://devzone.nordicsemi.com/thread/167224?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 22:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:762c1792-96d0-4ea0-a435-131773c00566</guid><dc:creator>wpaul</dc:creator><description>&lt;p&gt;0) I didn&amp;#39;t see any.&lt;/p&gt;
&lt;p&gt;1) I didn&amp;#39;t see any.&lt;/p&gt;
&lt;p&gt;2) ADPCM, Opus and MP3 are all different audio encoding/compression algorithms. So no, if you have software to decode ADPCM and/or Opus, it will will not also decode MP3.&lt;/p&gt;
&lt;p&gt;Note that MP3 was considered proprietary but I think the patents all expired in 2017 so there may no longer be any strings attached.&lt;/p&gt;
&lt;p&gt;Regardless of which codec or format you use, the idea is that you&amp;#39;ll need software to decode the data back into raw audio samples and then use the I2S block to play them. (You also will need to connect an I2S chip like the Cirrus Logic CS4344 in order to hear the sound.) The trick will be a) getting the codec library code to compile into your nRF52 project, and b) getting it to decode the audio data and feed it to the I2S controller fast enough so there&amp;#39;s no gaps in the playback. You&amp;#39;ll basically be doing:&lt;/p&gt;
&lt;p&gt;- read a chunk (from SD card)&lt;/p&gt;
&lt;p&gt;- decode a chunk&lt;/p&gt;
&lt;p&gt;- play a chunk&lt;/p&gt;
&lt;p&gt;If the &amp;quot;decode a chunk&amp;quot; step is too slow, your playback will be choppy.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve experimented with the nRF52 I2S block and gotten it to work, but I decided to just convert all my audio files to raw I2S samples rather than try to put any decompression or decoding software on the nRF52 itself. I used the SOX audio tool for this, using a command like the following:&lt;/p&gt;
&lt;p&gt;% sox --encoding signed-integer originalfile.mp3 outputfile.raw channels 2 rate 15625&lt;/p&gt;
&lt;p&gt;This is obviously for stereo mode. I chose a sample rate of 15.625KHz because it yielded acceptable audio quality and was a rate that was easily selectable using the MCLK frequencies and LRCLK divisors that Nordic saw fit to provide in their I2S implementation. Basically, this produces 16-bit sample data, with 15625 samples per second. Since this is stereo that means there&amp;#39;s 2 values per sample interval. You can estimate the file size from this. For example, say you have 20 seconds of audio:&lt;/p&gt;
&lt;p&gt;15625 x 2 bytes per sample x&amp;nbsp; 2 channels = 62500 bytes per second&lt;/p&gt;
&lt;p&gt;62500 bytes per second x 20 seconds = 1250000 bytes&lt;/p&gt;
&lt;p&gt;So your 20-second speech clip would be 1.25MB in uncompressed form. If you only want mono audio, it would be half that (625KB).&lt;/p&gt;
&lt;p&gt;You say you plan to have about 200 files. Worst case, at 1.25MB per file, that&amp;#39;s about 250MB. SD cards these days are often 8 or 16GB, so space should not be a problem. That&amp;#39;s probably a lot for QSPI though (last time I looked, the largest chip I could find was 256MB).&lt;/p&gt;
&lt;p&gt;In any case, using an uncompressed file might be handy at least for testing, so that you can figure out how to get audio from the SD card to the I2S controller. After that you can figure out how to incorporate a compression/decompression library.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>