<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Audio input from USB Stick to DAC in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Audio-input-from-USB-Stick-to-DAC/m-p/598384#M16653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I was able to read the directory from the usb stick and list it with the help of MQX user guides. Now &amp;nbsp;I need to read a particular wave file from the directory and pass it to the DMA buffer for the DAC output. Please share the fucntion to read a file from this directory using MQX and to save the contents of that file to a buffer so that I can copy it to the DMA buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;memset(buffer,0,100);&lt;BR /&gt; path_ptr = "*.*";&lt;BR /&gt; mode_ptr = "m";&lt;BR /&gt; fs_ptr = _io_get_first_valid_fs();&lt;BR /&gt; dir_ptr = _io_mfs_dir_open(fs_ptr, path_ptr, mode_ptr );&lt;BR /&gt; if (dir_ptr == NULL)&lt;BR /&gt; {&lt;BR /&gt; printf("File not found.\n");&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; while ((len = _io_mfs_dir_read(dir_ptr, buffer, 100))&amp;gt;0){&lt;BR /&gt; &lt;BR /&gt; strcpy(USB_Files,buffer);&lt;BR /&gt; printf(USB_Files);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; _io_mfs_dir_close(dir_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2016 05:24:56 GMT</pubDate>
    <dc:creator>oliviachristyva</dc:creator>
    <dc:date>2016-09-08T05:24:56Z</dc:date>
    <item>
      <title>Audio input from USB Stick to DAC</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Audio-input-from-USB-Stick-to-DAC/m-p/598383#M16652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to Embedded Software and now my task is to play an audio file from a USB stick using DAC.&lt;/P&gt;&lt;P&gt;I successfully played the audio file from the code using TWR- K60 and TWR-SER2 board and I got the output out of the DAC pin in TWR-K60 board(using AN4369SW). I was able to install the USB-MFS file system on the same board and its working fine . Also I integrated both the codes and both are working fine. But I dont know how to read the audio file from the USB Stick and give it to the DAC out directly without using SPI or other interface. I am working with MQX 4.2 in KDS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share your ideas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Olivia&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2016 11:57:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Audio-input-from-USB-Stick-to-DAC/m-p/598383#M16652</guid>
      <dc:creator>oliviachristyva</dc:creator>
      <dc:date>2016-09-07T11:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Audio input from USB Stick to DAC</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Audio-input-from-USB-Stick-to-DAC/m-p/598384#M16653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I was able to read the directory from the usb stick and list it with the help of MQX user guides. Now &amp;nbsp;I need to read a particular wave file from the directory and pass it to the DMA buffer for the DAC output. Please share the fucntion to read a file from this directory using MQX and to save the contents of that file to a buffer so that I can copy it to the DMA buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;memset(buffer,0,100);&lt;BR /&gt; path_ptr = "*.*";&lt;BR /&gt; mode_ptr = "m";&lt;BR /&gt; fs_ptr = _io_get_first_valid_fs();&lt;BR /&gt; dir_ptr = _io_mfs_dir_open(fs_ptr, path_ptr, mode_ptr );&lt;BR /&gt; if (dir_ptr == NULL)&lt;BR /&gt; {&lt;BR /&gt; printf("File not found.\n");&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; while ((len = _io_mfs_dir_read(dir_ptr, buffer, 100))&amp;gt;0){&lt;BR /&gt; &lt;BR /&gt; strcpy(USB_Files,buffer);&lt;BR /&gt; printf(USB_Files);&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; _io_mfs_dir_close(dir_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 05:24:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Audio-input-from-USB-Stick-to-DAC/m-p/598384#M16653</guid>
      <dc:creator>oliviachristyva</dc:creator>
      <dc:date>2016-09-08T05:24:56Z</dc:date>
    </item>
  </channel>
</rss>

