Part Number Hot Search : 
1N5713 44050 D1585 PR500 25F80 74ACT86 2SB1287 0498050
Product Description
Full Text Search
 

To Download AN4229 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  may 2014 docid024112 rev 1 1/26 AN4229 application note how to implement a vocoder soluti on using stm32 microcontrollers introduction this application note describes the vocal codecs (vocoder) available for stm32 32-bit arm ? cortex ? m icrocontrollers. the supported codecs are g.711, g.726, ima-adpcm and speex. it comes with examples of implementati on on stm32f4discovery (referred as discovery board hereafter), stm322xg-eval and stm324xg-eval (referred as eval boards hereafter). these examples are developed in such a way th at they can be easily ported to any other stm32 microcontroller and board. the vocoder firmware package is provided upon request, for more details please contact your local st sales representative. table 1. applicable products type applicable products microcontrollers stm32 32-bit arm cortex mcu www.st.com
contents AN4229 2/26 docid024112 rev 1 contents 1 vocoder overview and co mparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1 g.711 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 g.726 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3 ima-adpcm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4 speex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.5 vocoder comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.6 vocoder performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2 package content and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1 firmware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2 audio api description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3 player and recorder processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.1 audio player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.2 audio recorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.4 software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3 how to use the demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.1 hardware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 firmware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3 main application steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.1 player menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3.2 recording format menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.3.3 recorder menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.4 simple examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4 memory footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5 faq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6 references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
docid024112 rev 1 3/26 AN4229 list of tables 3 list of tables table 1. applicable products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. codecs comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 table 3. g.711 performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 table 4. g.726 decoder performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 table 5. ima-adpcm performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 table 6. speex encoder performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 table 7. speex encoded frame size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 table 8. project footprints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 9. faq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 table 10. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
list of figures AN4229 4/26 docid024112 rev 1 list of figures figure 1. g.726 versus g.711 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 2. project tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 3. firmware layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 4. demonstration architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 5. high layer audio player api . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 figure 6. high layer audio recorder api. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 7. player process (triple-buffering mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 8. recorder process (double-bufferi ng mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 9. initial state. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 10. player and recorder selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 figure 11. player description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 12. recording format selection menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 figure 13. recorder description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
docid024112 rev 1 5/26 AN4229 vocoder overview and comparison 25 1 vocoder overview and comparison a vocoder is a speech encoding, decoding and filtering application used to reproduce the human voice. in this application note, four speech codecs are implemented: g.711, g.726, ima-adpcm and speex. in the following sections, a short overview of these codecs is presented. 1.1 g.711 the g.711 codec is an itu-t (telecommu nication section of the international telecommunication union) standard for the compression of voice frequency signals. its principal features are: ? sampling frequency: 8 khz ? 64 kbit/s bitrate (8 khz sampling frequency, 8-bit samples) ? compression ratio: 1:2 ? used with itu-t re commendations g.726 g.711 defines two main compression algorithms, the -law algorithm (used in north america and japan) and a-law algorithm (used in europe and the rest of the world). both are logarithmic, but a-law was specifically designed to reduce computer processing requirements. g.711 is primarily used in telephony, but it can also be used for fax communication over ip networks. 1.2 g.726 g.726 is an itu-t adpcm speech codec standard covering the transmission of voice at rates of 16, 24, 32, and 40 kbit/s; actually, it supersedes both g.721 (adpcm at 32 kbits/s) and g.723 (adpcm at 24 and 40 kbits/s). it also introduces a new 16 kbit/s rate ( figure 1 ). g.726 main features are: ? sampling frequency: 8 khz ? bitrates: 16 kbit/s, 24 kbit/s, 32 kbit/s and 40 kbit/s ? uses adaptive differential pulse code modulation (adpcm) in addition to dect (digital enhanced cordless telecommunications) telephony, where g.726 is widely used, it is also used in seve ral fields such as data and voice carrying (depending on the selected channel bitrate).
vocoder overview and comparison AN4229 6/26 docid024112 rev 1 figure 1. g.726 versus g.711 1.3 ima-adpcm adpcm (adaptive differential pulse code modulati on) is a variant of dpcm that varies the size of the quantization step, to allow further reduction of the required bandwidth for a given signal-to-noise ratio. ima-adpcm is a legacy audio codec developed by interactive multimed ia association (ima) with the following characteristics: ? sampling frequencies: 8 (only frequency suppo rted here), 11.025, 22.05, or 44.1 khz. ? compression ratio: 1:4 the main advantage of the ima adpcm compress ion algorithm reside in its simplicity. the algorithm is not limited to voice signals and can operate at any input sampling rate thus enabling compression of high quality audio as well. 1.4 speex the speex codec is an open-source, patent-free and royalty-free software dedicated to speech compression and decompression. speex is based on celp (code excited linear prediction) and designed to compress voice at bitrates ranging from 2 to 44 kbit/s. 069 *$ * 'x? ??<]?l? 'x?? ?ele<]?l? .elwv 'x e<]?l? er]? ?u?o ~?<]?l? ?r]?ro }?rro ?u?o ?u?ueu?]?? wd ?u?o &&,7  &&,7  &&,7  ,78  ,78  /d w]v??v?]}vo?op??zv?o?z}v}v?o??]}uu]?? /dh w]v??v?]}vo?o}uuv]?]}vv]}v
docid024112 rev 1 7/26 AN4229 vocoder overview and comparison 25 the features of speex include: ? three different sampling rates: narrowband (8 khz), wideband (16 khz) and ultra- wideband (32 khz) ? wide range of bitrates available (from 2 kbit/s to 44 kbit/s) ? quality: ranges from 0 to 10 ? variable complexity: ranges from 1 to 10 ? variable bitrate (vbr) ? voice activity detection (vad) ? perceptual enhancement? speex is targeted at voice over ip (voip) and file-based compression. the design goals have been to make a codec that would be optimi zed for high quality speech and low bit rate. also, several other applications support the speex codec such as streaming applications, videogames and audio processing applications. 1.5 vocoder comparison table 2 summarizes and compares general and technical information for the previously presented codecs. table 2. codecs comparison codec name g.711 g.726 ima-adpcm speex creator itu-t itu-t ima (interactive multimedia association) xiph.org foundation algorithm companding a-law or -law, pcm, lossy adpcm, lossy adaptive differential pulse code modulation) celp (code excited linear prediction) license gpl gpl free patent-free (bsd license) bitrate (kbits/s) 64 16, 24, 32, 40 32 2.15 to 24.6 (nb) 4 to 44.2(wb) sampling rate (khz) 8 8 8 8, 16, 32 bits per input sample 16 13 16 16 bits per output sample 8 2, 3, 4, 5 4 latency: 30 ms (nb), 34 ms (wb) application ? voice recording and playback ?voip ? automated announcement systems ? intercom ? walkie-talkie ? voice recording and playback ?voip ? automated announcement systems ? speech compression in telecommunications ? voice recording and playback ?voip ? streaming applications (teleconference)
vocoder overview and comparison AN4229 8/26 docid024112 rev 1 1.6 vocoder performance table 3 to table 6 show measurements for g.711, g.726, ima-adpcm and speex codecs. performance data are measured on stm32f4 device at system clock equal to 168mhz with 5 wait states and compilation optimization parameter set to high. speex data measurements are done on stm32f4discovery while all the other codecs are tested on stm3240g-eval board. benefits ? designed to deliver precise transmission of speech ? very low processing overheads ? uses 32 kbits which is half the rate of g.711 codec and hence increases the usable network capacity by 100% ? very much used on international trunks in the phone network ? transmit only the difference between the real and the predicted value ? predict the current signal value from previous value ? integration of nb and wb in the same bitstream ? wide range of bitrates ? dynamic bitrate switching and ariable bitrate (vbr) ? voice activity detection (vad, integrated with vbr) ? variable complexity ? intensity stereo encoding option drawbacks ? poor network efficiency ? lacks missing packet interpolation ? not well-suited for sound effects ? low compression rate (equal to ?) ? quality is permanently degraded to reduce file size ? by only specifying quality parameter, there's no guaranty about the final average bitrate table 2. codecs comparison (continued) codec name g.711 g.726 ima-adpcm speex table 3. g.711 performance parameter g.711 encoder g.711 decoder -law a-law -law a-law flash memory (bytes) 94 78 84 62 ram (bytes) 0 0 0 0 load (mhz) 0.38 0.3 0.22 0.2
docid024112 rev 1 9/26 AN4229 vocoder overview and comparison 25 table 4. g.726 decoder performance parameter (1) 1. bitrate: 32 kbits/s g.726 decoder -law a-law pcm flash memory (bytes) 2026 2018 1604 ram (bytes) 144 144 144 load (mhz) 18.06 17.55 11.76 table 5. ima-adpcm performance parameter ima-adpcm enco der ima-adpcm decoder flash memory (bytes) 416 416 ram (bytes) 16 16 load (mhz) 0.62 0.51 table 6. speex encoder performance quality (1) 1. complexity = 1 load (mhz) narrowband wideband 1 40.8 53.4 2 33.6 46.2 3 37.2 49.8 4 37.2 64.2 5 52.2 56.4 6 52.2 70.2 7 44.4 98.4 8 44.4 114 9 72.6 100.8 10 59.4 -
package content and description AN4229 10/26 docid024112 rev 1 2 package content and description 2.1 firmware description stm32 audio vocoders package includes a set of firmware libraries used to build speech- based audio applications. the firmware is m ade up of a main application (demonstration) and four simple examples (one for each codec). the project tree is presented in figure 2 . figure 2. project tree there are multiple abstraction layers for the audio components. the main abstraction layer is located in "stm32_audio/common" (manages output interfaces, decoders and mass storage control), while all the encoding/decod ing operations are called by the abstraction 069 ^?v?vvo]??]? w?]v]?ou}v????]}vv?u?o? ^dd??]}}u?}vv??w r}v??]?? rs}]}? r]}????]}vo??~}uu}vw ?/v??]v??( ?k???]v??( ?}]v??(w?uw/(v?]}v(}? oo}? r,??o??~???zs>w]}?]?? ?o?]?}z?o?(}?u ^?v??o?(}?uz???]?? w?}(??~v}??v}?? dz]????]??]??
docid024112 rev 1 11/26 AN4229 package content and description 25 layer interfaces. figure 3 summarizes the different firmware layers in the vocoders demonstration. figure 4 shows the whole demonstration architecture. figure 3. firmware layers 069 670b$xglr+ljk/d\hu $xglr+dugzduh 6wrudjh &rghfv $8',2b287birsv )dw)6 670bdxglrbghfrghuv &rghfv ,6 ,& '0$ 6'&dug 86% * * ,0$ $'3&0 63((; 3od\hu 5hfrughu
package content and description AN4229 12/26 docid024112 rev 1 figure 4. demonstration architecture the stm322xg-eval and stm324xg-eval evaluation boards (referred as ?eval boards? hereafter) demonstrate the following main features: ? g.711, g.726, ima-adpcm and speex codecs support ? advanced display-based user interface ? play and record on sd card and usb ? playback features: play, stop, next and previous ? file information display (title , format, record /play status) ? control via joystick (navigation and selection) and for the stm32f4discovery board (referred as ?discovery board? hereafter): ? g.711, g.726, ima-adpcm and speex codecs support ? led-based user interface ? play and record on usb flash drive only ? playback features: play, stop, next and previous ? control via mems accelerometer and "user" push button 069 0e\whviodvkphpru\ &ruwh[ ? &38 ??l??<??? ^zd d ]p]?o (]o??? wd }? w???? &?&^ ^?? /dr wd 'x 'x? h^,}??>] ^/k?]? d^o?? ,d/}v??}o? ]??o? h^kd'&^ ^/k &^d /?^ l^w/ d/d w>>o}l yd> }?]oo?}?? ??l,= er?d, ^? }vv?}? h^z}?? }vv?}? ]}  u? ??l?d, ??? &]o??ldd^ k?v?}? &tlw/(?}u^d
docid024112 rev 1 13/26 AN4229 package content and description 25 while simple examples features are: ? only one codec (amongst g.711, g.726, ima-adpcm and speex) is supported in each example ? minimalist user interface ? play and record on internal flash memory ? simple commands using tamper (play/stop) and key (record/stop) push buttons 2.2 audio api description there are multiple abstraction layers for the audio components: ? decoders and mass storage operation management ? output interface (codec, i2s,dma?) management, independently from fatfs operations: it allows managing all output in terface without caring about hardware layer ? input interface (adc, mems pdm, microph ones?): it allows managing all input interfaces without caring about hardware layer. ? high abstraction layer (audioplayer_xxx and audiorecorder_xxx) all decoding/encoding operations are called by the abstraction layer interfaces (audioplayer and audiorecorder) as well as the read/write f unctions using fatfs library or equivalent for read/write operations from inte rnal stm32 flash memory. so when the application calls this level of api, it doesn't need to ca ll decoders/encoders or mass storage open/write/read/close functions. figure 5 and figure 6 explain the structur e of the high layer for the audio player and recorder respectively.
package content and description AN4229 14/26 docid024112 rev 1 figure 5. high layer audio player api 069 $xglr3od\hub,qlw $xglr3od\hub2shq $xglr3od\hub3od\ $xglr3od\hub3od\8sgdwh $xglr3od\hub6wrs $xglr3od\hub&orvh 5hdg 'hfrgh (qg riiloh ibrshq ibuhdg uhdgkhdghu 'hfrghuvb6hohfw'hfrghu $8',2b287birsv,qlw $8',2b287birsv6hw;ihu&sow&dooedfn ;ihu&sow&dooedfn
docid024112 rev 1 15/26 AN4229 package content and description 25 figure 6. high layer audio recorder api 2.3 player and re corder processes 2.3.1 audio player the audio player uses the triple buffering method to perform the following steps: 1. read frames from the mass storage device. 2. decode frames with the selected codec 3. transfer decoded frames to the audio jack through the i2s interface. this transfer is performed by dma, so cpu is free to perform other tasks while i2s is getting data from decoded buffers. the dma transfer complete interrupt informs the player task that a new buffer needs to be read and decoded. while the dma outputs a buffer, the application reads and decodes other buffers. figure 7 describes this triple-buffering process. 069 ]}z}??z/v]? ]}z}??zk?v ]}z}??z^??? ]}z}??zh?? ]}z}??z^?}? ]}z}??zo}? v} t?]? y(??o?ool 8vhu 6wrsdfwlrq0d[ ilohohqjwk
package content and description AN4229 16/26 docid024112 rev 1 figure 7. player process (triple-buffering mode) 2.3.2 audio recorder audio recorder buffering task consists on getting the recorded frame from the adc peripheral then encode it and write it to mass storage device. adc conversion is triggered by a timer. once a buffer is ready, the recorder task is notified and gets the ready buffer for encoding and writing. as shown in figure 8 , double buffering is used for this module. figure 8. recorder process (double-buffering mode) 2.4 software in addition to the firmware described above, the vocoders package includes also four software applications (pc applets) that allow the user to encode and decode audio files on the pc with the different voice codecs. 069 5hdg % 5hdg % 'hfrgh % 5hdg % 'hfrgh % 'hfrgh % 3od\ % 3od\ % 3od\ % 5hdg % 5hdg % 'hfrgh % 'hfrgh % h???]}vw>z wo???l???? dy(?}u?o? 069 5hfrug % 5hfrug % 5hfrug % 5hfrug % (qfrgh % (qfrgh % (qfrgh % :ulwh % :ulwh % :ulwh % h???]}vzkz dy(?}u?o?
docid024112 rev 1 17/26 AN4229 how to use the demonstration 25 3 how to use the demonstration 3.1 hardware configuration supported boards are: stm32f4discovery (r eferred as discovery board hereafter), stm322xg-eval and stm324xg-eval (referred as eval boards hereafter). eval boards settings for the "demonstration": ? connect a usb flash drive to t he usb otg fs connector (cn8). ? connect an sd card to the msc connector (cn6), also jumper jp16 must be set to position 1-2 (msd) to be able to use sd card. ? connect a headset (headphone + microphone) to the audio jack connector (cn11). eval boards settings for the simple examples (such as "simple_g711"): ? connect a headset (headphone + microphone) to the audio jack connector (cn11). discovery board settings: ? connect a usb flash drive to t he usb otg fs connector (cn5). ? connect a headphone to the audio jack connector (cn4); no external microphone is needed as the mems integrated microphone (u9) is used. 3.2 firmware configuration all the settings that a typical user needs to adjust are regrouped into one single file: demonstration\inc\audio_app_conf.h. for example playlist_directory and record_directory permit to set the directory paths where the play er/recorder will read /write audio files. note that "0:/" corresponds to usb flash drive and "1:/" corresponds to sd card. in addition to general audio settings, such as volume (default_volume) and sampling frequency (sample_rate_freq), all the codecs parameters can also be set into this file (audio_app_conf.h). there is only one exceptio n: the speex mode selection (narrowband or wideband) is set directly into the preprocessor defined symbols. users should take in consideration the following correspondence table ( table 7 ) when setting speex parameters: table 7. speex encoded frame size spx_encoder_quality encoded_frame_size narrowband wideband 11015 21520 32025 42032 52842 62852
how to use the demonstration AN4229 18/26 docid024112 rev 1 note as well that all the codecs parameters can also be set into the codec process header files: ? g711process.h ? g726process.h ? adpcmprocess.h ? speexprocess.h but if the same parameter is se t into anyone of these files as well as in the general setting file (audio_app_conf.h), only this last one is taken into account. 3.3 main application steps in the initial state (main menu ), all leds are blinking ( figure 9 ). the user can then select the player or recorder. figure 9. initial state 73860 83870 94686 10 62 106 table 7. speex encoded frame size (continued) spx_encoder_quality encoded_frame_size narrowband wideband 069 670)[[$xglr9rfrghuv eh?:}???]l??z??}v?}?o? v?]}vw ?h?l} vwzvp?o?]}v ? o]lwso]? 3/$<(5 5(&25'(5 670$xglr9rfrghuv3dfndjh9 670)',6&2 9(5< $oo/('vduheolqnlqj -r\vwlfnxsgrzq fkdqjhvhohfwlrq -r\vwlfnfhqwhu ydolgdwhvhohfwlrq $oo/('vduh eolqnlqj 8vhusxvkexwwrq ydolgdwhvhohfwlrq
docid024112 rev 1 19/26 AN4229 how to use the demonstration 25 on eval boards the selected module is highlighted. use joystick up and down to change selection and joystick center to validate the selection and navigate to next menu. on discovery board, rotate the board to the left or right to change selection and push user button to validate it. in the main menu, if the green led is on then the player module is selected while the red led corresponds to the recorder module ( figure 10 ). figure 10. player and recorder selection 3.3.1 player menu in the audio player menu there are four poss ible actions: play, next, previous and stop. on discovery board, here are the corres pondences between leds indications and selected actions: ? orange led is on: play action selected ? red led is on: next action selected ? blue led is on: prev action selected ? green led is on: stop action selected on eval board display the selected action is clearly highlighted together with some useful information: number of supported files found on media storage, currently selected file name, player status. additionally, the leds provide an indication on the audio player status (see figure 11 ). 069 670)[[$xglr9rfrghuv !8vh-r\vwlfnsxvkexwwrqwr vhohfwdqdfwlrq          8s'rzq&kdqjhvhohfwlrq          &olfn9dolgdwh 3/$<(5 5(&25'(5 670$xglr9rfrghuv3dfndjh9 670)',6& 29(5< 670)',6& 29(5< 670)[[$xglr9rfrghuv !8vh-r\vwlfnsxvkexwwrqwr vhohfwdqdfwlrq          8s'rzq&kdqjhvhohfwlrq          &olfn9dolgdwh 3/$<(5 5(&25'(5 670$xglr9rfrghuv3dfndjh9 5rwdwhwkherdug wrwkhohiwwrwxuq rqjuhhq/(' 3/$<(5 vhohfwhg 5rwdwhwkherdug wrwkhuljkwwrwxuq rquhg/(' 5(&25'(5 vhohfwhg
how to use the demonstration AN4229 20/26 docid024112 rev 1 figure 11. player description 3.3.2 recording format menu before accessing the recorder menu, user sh ould first select a re cording format in the intermediate menu ( figure 12 ). on discovery board, the leds are blinking duri ng this step in order to differentiate the format selection menu from the player menu. figure 12. recording format selection menu 069 9rfrghuv$xglr3od\hu eh?:}???]l??z??}v?}?o? v?]}vw ?h?l} vwzvp?o?]}v ? o]lwso]? e]}(]o?(}vx e&]oeuw]}z(]ox e]}^???ww>z/e' 3/$< 1(;7 670$xglr9rfrghuv3dfndjh9 35(9 6723 670)',6&2 9(5< :khq3/$<lv vhohfwhg dqg ydolgdwhg eoxh /('lvrq :khq6723lv vhohfwhg dqg ydolgdwhg rudqjh /('lvrq *uhhq/('lv dozd\veolqnlqj 3/$< 1(;7 35(9 6723 )lohvlqir dqgsod\hu vwdwxv 069 670)',6&2 9(5< * * ,0$ $'3&0 63((; 9rfrghuv5hfruglqj)rupdw eh?:}???]l??z??}v?}?o? v?]}vw ?h?l} vwzvp?o?]}v ? o]lwso]? * * 670$xglr9rfrghuv3dfndjh9 ,0$$'3&0 63((;
docid024112 rev 1 21/26 AN4229 how to use the demonstration 25 3.3.3 recorder menu in the recorder menu ( figure 13 ) there are three possible actions: record, stop and play. on discovery board, here are the corres pondences between leds indications and selected actions: ? orange led is on: record action selected ? red led is on: stop action selected ? blue led is on: play action selected ? green led is always blinking on eval board, the following items are displayed ( figure 13 ): ? actions menu ? recording codec name (selected from previous menu) ? recording parameters ? recorder status. figure 13. recorder description 3.4 simple examples simple examples are provided only on eval boards. encoding/decoding is performed on/from internal flash memory so no external media storage is needed. there are four simple examples (one for each codec): ? simple_g711 ? simple_g726 ? simple_ima-adpcm ? simple_speex the display is minimalist and there is no menu selection. the control is done by key and tamper push button to respecti vely record/stop and play/stop. 069 9rfrghuv$xglr5hfrughu eh?:}???]l??z??}v?} ?o?v?]}vw         ?  h?l}vwzvp?o?]}v         ?  o]lwso]? e}?o?w'? ev}?ow>]v?rwd e}?owwdr>]v? e]???w??<l? e]}^???wzkz/e' 5(&25' 6723 670$xglr9rfrghuv3dfndjh9 3/$< 670)',6& 29(5< :khq3/$< lvvhohfwhg dqg ydolgdwhg  eoxh/('lv rq :khq5(&25'lv vhohfwhg dqg ydolgdwhg uhg/(' lvrq *uhhq/('lv dozd\veolqnlqj 5(&25' 6723 3/$< 5hfruglqj frghfqdph uhfruglqj sdudphwhuv dqguhfrughu vwdwxv :khq6723lv vhohfwhg dqg ydolgdwhg rudqjh /('lvrq
memory footprint AN4229 22/26 docid024112 rev 1 4 memory footprint the footprint results are computed using ewarm v6.40 compiler with high size optimization level. table 8. project footprints project flash memory (bytes) sram (bytes) rw data ro code ro data demonstration on eval board 76 992 18 069 82 602 demonstration on f4-discovery 70 056 9 436 83 163 simple_g711 26 692 9 451 10 660 simple_g726 23 808 9 677 10 512 simple_ima-adpcm 22 372 9 441 10 160 simple_speex 54 584 19 892 75 912
docid024112 rev 1 23/26 AN4229 faq 25 5 faq this section gathers some of the most fr equent questions vocoders package users may ask. it gives some solutions and tips. table 9. faq no. question answer/solution 1 how to select media storage (usb flash drive or sd card)? in file ?audio_app_conf.h?, set playlist_directory and/or record_directory to ?0:/? to select usb flash drive and ?1:/? to select sd card. by default these two defines are set to ?0:/user?. 2 how to configure codecs parameters? almost all codec parame ters can be set into ?audio_app_conf.h? file. see section 3.2 for other alternatives. 3 is there any parameter to configure when implementing the application in eval boards or discovery board? all necessary configurations are already done and managed by these three defines: use_stm322xg_eval, use_stm324xg_eval and use_stm3f4xx_discovery. as reference, main differences are: ? hse_value (equal to 8 mhz on the discovery board and 25 mhz on the eval board) ? lcd support (only on eval) ? sd card support (only on eval) ? mems accelerometer support (only on discovery board) ? usb power switch port configuration (host_powersw_port_rcc, host_powersw_port and host_powersw_vbus) 4 how to add a new codec? to allow the application to support new codec, the user should: ? add codec routines under ?codecs/? ? add the codec functions (callbacks) layer regrouped into a new file called ?xxxprocess. c? (under common/). user can take ?wavprocess.c? as reference. ? update file ?common/stm32_audio_decoders.c? to support new function associations. normally, the other layers (player, recorder, audio_in and audio_out interfaces) do not have to be modified. 5 how to disable lcd display on eval board? un-define (comment) lcd_enable, into ?audio_app_conf.h?.
references AN4229 24/26 docid024112 rev 1 6 references ? speex: http://www.xiph.org ? itu-t recommendation g.711: http://www.itu.int ? itu-t recommendation g.726: http://www.itu.int
docid024112 rev 1 25/26 AN4229 revision history 25 7 revision history table 10. document revision history date revision changes 27-may-2014 1 initial release.
AN4229 26/26 docid024112 rev 1 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a parti cular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. st products are not designed or authorized for use in: (a) safety critical applications such as life supporting, active implanted devices or systems wi th product functional safety requirements; (b) aeronautic applications; (c) automotive applications or environments, and/or (d) aerospace applications or environments. where st products are not designed for such use, the purchaser shall use products at purchaser?s sole risk, even if st has been informed in writing of such usage, unless a product is expressly designated by st as being intended for ?automotive, automotive safety or medical? industry domains according to st product design specifications. products formally escc, qml or jan qualified are deemed suitable for use in aerospace by the corresponding governmental agency. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or registered trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2014 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - philippines - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com


▲Up To Search▲   

 
Price & Availability of AN4229

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X