Application Note AN_276. FT800 Audio File Conversion



Similar documents
Application Note AN_385. FTDI D3XX Driver Installation Guide

Technical Note TN_152. USB 3.0 Compatibility Issues Explained

Application Note AN_242

Application Note AN_243. FT312D USB Host to UART Cable Application

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows 7

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

Application Note AN_101. Submitting Modified FTDI Drivers for Windows Hardware Certification

White Paper WP_001. Connecting Peripherals to an Android Platform

Technical Note TN_146. Creating Android Images for Application Development

Technical Note TN_158. What is the Camera Parallel Interface?

Future Technology Devices International Ltd. Application Note AN_234. FTDI Drivers Installation guide for. Windows 8

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

Technical Note. TN_134 FTDI Android D2XX Driver

Determining USB Peripheral Device Class

Application Note. AN_136_Hi-Speed Mini Module EEPROM Disaster Recovery

UMFT4222PROG FT4222 Programmer Module

Application Note AN_149. Upgrading a passive DB9 RS232 Interface to an active USB Interface using an FTDI DB9-USB-RS232 Module

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

Future Technology Devices International Ltd

Technical Note. TN_132 Adding FTDI Devices VCP Driver Support to Android

Future Technology Devices International Ltd

Application Note AN_185. Vinculum-II UART to USB HID Class Host Bridge

Application Note AN_252. FT800 Audio Primer

Technical Note. TN_147 Java D2xx for Android

Future Technology Devices International Ltd. AN232R-02 FTDIChip-ID for the FT232R and FT245R

FTDI Chip. VM800P Datasheet Embedded Video Engine Plus Module. VM800P Embedded Video Engine Plus Module Datasheet Version 1.0

Command Processor for MPSSE and MCU Host Bus Emulation Modes

Simplified Description of USB Device Enumeration

Future Technology Devices International Ltd. USB NMC-2.5m. USB to USB Null Modem Cable. Datasheet

Application Note AN_254. FT800 Designs With Visual TFT

Future Technology Devices International Ltd. USB-Key. Datasheet

TTL-232R. TTL to USB Serial Converter Range of Cables. Datasheet

FT2232H Mini Module. USB Hi-Speed FT2232H Evaluation Module. Datasheet

FT4232H Mini Module. USB Hi-Speed FT4232H Evaluation Module. Datasheet

C232HD. USB 2.0 Hi-Speed to UART Cable. Datasheet

TTL-232R-PCB. TTL to USB Serial Converter PCB. Datasheet

VF2F. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit. Future Technology Devices International Ltd. Preliminary - Subject to Change

USB Hi-Speed Serial/Hub Module. Datasheet

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

Application Note AN_208. FT311D and FT312D Demo_APK_User_GuideFT311D and FT312D Demo_APK_User_Guide

Future Technology Devices International Ltd. Technical Note TN_101

VDIP1. Vinculum VNC1L Module. Datasheet

C232HM. USB 2.0 Hi-Speed to MPSSE Cable. Datasheet

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows VISTA

Future Technology Devices International Ltd. USB to RS232 UART Serial Converter PCB. Datasheet

Future Technology Devices International Ltd. VF2F2. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit.

Future Technology Devices International Ltd USB TO RS422 UART SERIAL CONVERTER PCB. Datasheet. Document Reference No.: FT_000119

Future Technology Devices International Ltd. Windows XP Installation Guide

Vinco Development Module. Datasheet

Application Note AN_146. USB Hardware Design Guidelines for FTDI ICs

Future Technology Devices International Ltd

USB-COM422-PLUS2. Datasheet

USB-COM422-PLUS1. Datasheet

Technical Note TN_105

The DB9-USB Family of. UART Converter Modules. Datasheet

DB9-USB-RS232 Module. Male & Female. Datasheet

USB-COM232-PLUS4. Datasheet

Future Technology Devices International Ltd. USB to RS232 Serial Converter Range of Cables. Datasheet

TTL-232R-3V3 USB to TTL Serial Converter Cable

QUICK SETUP GUIDE SETUP FOR ICONNEX SOUNDCARD AND AUDACITY RECORDING SOFTWARE

Application Note AN_240. FT800 From the Ground Up

Application Note AN_100. Using the FT232R/FT245R with an External Crystal or Oscillator

Preservation Handbook

IP Office - Job Aid Music on Hold

Application Note AN_113. Interfacing FT2232H Hi-Speed Devices To I2C Bus

TTL-232R. TTL to USB Serial Converter Range of Cables. Datasheet

Prolific USB to SATA Bridge Controller Backup Software User s Manual

itunes 7.0 Fall 07 fall 2007

Audio File Manager For MRS Series

MP3/mp3PRO plug-in. How you can make an audio CD from mp3 or mp3pro files

Tutorial. Part One -----Class1, 02/05/2015

Audacity Sound Editing Software

FTDI Ltd DS_US232R-10(R-100/500) USB to RS232 Adapter cable. Data Sheet

DCT-16 USB HD Audio Converter

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

Hosted Voice Business Group Administrator Quick Start Guide

Future Technology Devices International Ltd. FT311D

How to Install and use Windows XP Mode and Windows Virtual PC in Windows 7 for older 32 bit only Applications

How to install and use the File Sharing Outlook Plugin

Type of Party on Hold. SIP Trunk, / ISDN CO/ ISDN Trunk via FXO gateway (Incoming) SIP Trunk, ISDN CO/ ISDN Trunk via FXO gateway (Outgoing)

FTDI Chip Microcontrollers BRIDGING TECHNOLOGIES

Audacity is a free, totally free, audio editing program. Get it here:

VIA High Definition Audio VDeck User Guide Black Skin

Recording and Editing Audio with Audacity

Configuring Music on Hold on the NetVanta 7000 Series

Roxio Easy LP to MP3 Getting Started Guide

Operating Instructions. Network Audio Player N-70A/N-50A USB Audio Driver software (for Windows)

Announcements User Manual (KPN)

SL1100 Digital Call Logger User Guide

DSG SoftPhone & USB Phone Series User Guide

Audacity: record, import & export on Windows & Macintosh platforms

Cubase LE 5. Installing Cubase LE 5. Trademarks. Quick Start Guide

Quick Start Guide. GV-Redundant Server GV-Failover Server. 1 Introduction. Packing List

Transcription Module Easy Start Guide

Transcription:

AN_276 FT800 Audio File Conversion Issue Date: 2014-02-10 This document shows how to change an audio file into the correct format for the FT800 audio player. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold FTDI harmless from any and all damages, claims, suits or expense resulting from such use. Future Technology Devices International Limited (FTDI) Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 Web Site: http://ftdichip.com Copyright 2011 Future Technology Devices International Limited

Table of Contents 1 Introduction... 2 1.1 Scope... 2 1.2 Software Required... 2 1.3 FT800 Audio Requirements... 2 2 Working with Audacity... 3 3 Working with the FT800 Audio Converter... 5 4 Configuring FT800 Audio Playback Properties... 6 5 Conclusion... 7 6 Contact Information... 8 Appendix A References... 9 Document References... 9 Acronyms and Abbreviations... 9 Appendix B List of Tables & Figures... 10 List of Tables... 10 List of Figures... 10 Appendix C Revision History... 11 1

1 Introduction This applications note documents how to convert audio files (mp3, ogg Vorbis, AIFF) to an FT800 compatible format. 1.1 Scope This document covers the basic file conversion process and how to access the converted audio files with the FT800. 1.2 Software Required Audacity (open source, available for free download) Aud_Cvt (EVE Audio Converter) 1.3 FT800 Audio Requirements The FT800 can use the following audio formats for monaural playback: 8 bit signed PCM 8 bit u-law 4 bit IMA ADPCM Figure 1.1 shows the audio file conversion flow: Figure 1.1 File Conversion Flow 2

2 Working with Audacity Start the Audacity tool and open an existing mp3 music file by using the File/Open pull down menu. In this example, I.Allegro.mp3 is selected. Table 2.1 Audacity file selection The mp3 file will be read into Audacity. The file must be converted from stereo to mono by clicking on the options icon in the margin and selecting Split Stereo to Mono in the pull down menu. Make a note of the sampling rate, since this will be used in the FT800 application. Table 2.2 Audacity audio options 3

The Audacity screen will look like this after Mono mode is selected: Table 2.3 Mono mode enabled In the File pull down menu, select Export and save the file as a 16 bit signed PCM wav file: Table 2.4 Save WAV as 16 bit PCM Click OK on the succeeding pop-up menus. The WAV file is now in the correct 16 bit signed PCM wav format for the next conversion step. 4

3 Working with the FT800 Audio Converter The FT800 audio conversion utility is aud_cvt. This utility only works with 16 bit PCM coded WAV files. Open a command prompt window (DOS window) and change the working directory to the folder containing the aud_cvt.exe. It is also advisable to copy the file to be converted to this folder. Command line format: Output format options: aud_cvt i input_filename f format <ret> 0 : 8 Bit signed PCM 1 : 8 Bit u-law 2 : 4 Bit IMA ADPCM In most cases, 8 Bit u-law is the target format. For the I.Allegro WAV file, the command is as follows: aud_cvt i I.Allegro.wav f 1 <ret> This will create a subdirectory called I_8 Bit ulaw. The target file in this subdirectory will be I.raw. The sampling rate will also be displayed when aud_cvt runs. This raw format audio file is now ready for use with the FT800. 5

4 Configuring FT800 Audio Playback Properties Set the sampling rate of the input audio file by using the REG_PLAYBACK_FREQ register. The sampling rate may change based on the structure of the audio file. Refer to the output from Audacity or aud_cvt to get the sampling rate. Ft_Gpu_Hal_Wr32(phost,REG_PLAYBACK_FREQ,44100); //16 bit PCM wav sampling rate 44.1kHz Set the starting location of audio in GRAM by using the REG_PLAYBACK_START register. Ft_Gpu_Hal_Wr32(phost,REG_PLAYBACK_START,0); //begin at start of.raw file Set the size of the GRAM allocated for audio by using the REG_PLAYBACK_LENGTH register. Ft_Gpu_Hal_Wr32(phost,REG_PLAYBACK_LENGTH,8192L); //default is 8192L In this demo application, the allocated size of GRAM is 8KB. Set the audio file type to u-law by using the REG_PLAYBACK _FORMAT register. Ft_Gpu_Hal_Wr32(phost,REG_PLAYBACK_FORMAT,1); // default is ULAW_SAMPLES Set the speaker volume by using the REG_VOL_PB register. Default volume is 100. Ft_Gpu_Hal_Wr8(phost,REG_VOL_PB,100); Read in the audio file from the project subdirectory as follows: afile = fopen("..\\..\\..\\test\\filename.raw","rb"); //read binary (rb) filename.raw In this example, the size of the audio file is about 9 MB. The 8KB of GRAM is looped for 9MB audio by setting the register REG_PLAYBACK_LOOP to 1: Ft_Gpu_Hal_Wr32(phost,REG_PLAYBACK_LOOP,1); //default is 1 loop If the audio file is less than 8KB, set the register REG_PLAYBACK_LOOP to 0. The 9 MB audio file will be processed by performing multiple read/writes of GRAM memory. The REG_PLAYBACK_READPTR command keeps track of how much of the audio file has been read. fseek(afile,0,seek_end); ftsize = ftell(afile); fseek(afile,0,seek_set); Load_afile(0,afile); wp = 512L; Ft_Gpu_Hal_Wr8(phost,REG_PLAYBACK_PLAY,1); while(ftsize > 0) { rp = Ft_Gpu_Hal_Rd16(phost,REG_PLAYBACK_READPTR); val = 8191L & (rp-wp); if (val > 512L) { n = min(512l,ftsize); Load_afile(wp,afile); wp = (wp +512L) & 8191L; ftsize-=n; } } Ft_Gpu_Hal_Wr8(phost,REG_VOL_PB,0); Ft_Gpu_Hal_Wr8(phost,REG_PLAYBACK_PLAY,0); 6

5 Conclusion The conversion procedure described in this application note can be used to create audio files for playback within the FT800. This expands the audio capability of the FT800 beyond the range of the in-built polyphonic tones helping to create a rich and feature filled HMI solution. 7

6 Contact Information Head Office Glasgow, UK Future Technology Devices International Limited Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) sales1@ftdichip.com support1@ftdichip.com admin1@ftdichip.com Branch Office Tigard, Oregon, USA Future Technology Devices International Limited (USA) 7130 SW Fir Loop Tigard, OR 97223-8160 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) us.sales@ftdichip.com us.support@ftdichip.com us.admin@ftdichip.com Branch Office Taipei, Taiwan Future Technology Devices International Limited (Taiwan) 2F, No. 516, Sec. 1, NeiHu Road Taipei 114 Taiwan, R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 Branch Office Shanghai, China Future Technology Devices International Limited (China) Room 1103, No. 666 West Huaihai Road, Shanghai, 200052 China Tel: +86 21 62351596 Fax: +86 21 62351595 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) tw.sales1@ftdichip.com tw.support1@ftdichip.com tw.admin1@ftdichip.com E-mail (Sales) E-mail (Support) E-mail (General Enquiries) cn.sales@ftdichip.com cn.support@ftdichip.com cn.admin@ftdichip.com Web Site http://ftdichip.com System and equipment manufacturers and designers are responsible to ensure that their systems, and any Future Technology Devices International Ltd (FTDI) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested FTDI devices and other materials) is provided for reference only. While FTDI has taken care to assure it is accurate, this information is subject to customer confirmation, and FTDI disclaims all liability for system designs and for any applications assistance provided by FTDI. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold harmless FTDI from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Future Technology Devices International Ltd, Unit 1, 2 Seaward Place, Centurion Business Park, Glasgow G41 1HH, United Kingdom. Scotland Registered Company Number: SC136640 8

Appendix A References Document References Replace this text. List FTDI and external datasheets, application notes, website links and other documents. Notice the hyperlink in the example. AN_146 USB Hardware Design Guides for FTDI ICs AN_267 FT App Player Acronyms and Abbreviations Terms AD-PCM PCM u-law PCM Description Adaptive pulse code modulation varies the quantization of the analog source to improve sound quality and reduce file size. Pulse Code modulation is used to digitally sample analog signals. Type of PCM format using a 16-bit signed linear audio sample as input, outputs an 8 bit sample. 9

Appendix B List of Tables & Figures List of Tables Table 2.1 Audacity file selection... 3 Table 2.2 Audacity audio options... 3 Table 2.3 Mono mode enabled... 4 Table 2.3 Save WAV as 16 bit PCM... 4 List of Figures Figure 1.1 File Conversion Flow... 2 10

Appendix C Revision History Document Title: Document Reference No.: FT_000937 Clearance No.: FTDI# 369 : http://www.ftdichip.com/ftproducts.htm : Send Feedback Revision Changes Date 1.0 Initial Release 2014-02-10 11

12