Recent changes
Slingshot user guide
tag Guide, user
NFCLamp user guide
tag Guide, user
Homepage
MPL115A2
Compiler Error 42
From the mbed microcontroller Cookbook.  

SMARTWAV

Presentation

This page presents a library to use a SMARTWAV intelligent embedded audio processor from vizic technologies: the easiest way to add High Quality Stereo Sound to any project: http://vizictechnologies.com/#/smart-wav/4559021187 (http://www.vizictechnologies.com) The Audio module features are :

SMARTWAV intelligent embedded Audio processor unit

SMARTWAV front

SMARTWAV side

SMARTWAV + earphones

SMARTWAV on a breadboard

SMARTWAV XPLAINED

Connecting the SMARTWAV

SmartWAV Typical connections...

-Serial Mode:

SmartWAV Serial Mode

-Stand-Alone Mode(no controller needed):

SmartWAV Stand-Alone Mode

SMARTWAV mbed Library

You can import the SMARTGPU mbed Library from here :

» Import this library into a programSMARTWAV

SMARTWAV mbed Library for use with the SMARTWAV audio processor, http://vizictechnologies.com/#/smart-wav/4559021187 www.vizictechnologies.com

Once it is imported to your program folder, just insert the #include "SMARTWAV.h" in your main.cpp and create the object with SMARTWAV sWav(p13,p14,p15); (TX,RX,Reset)

Example Code

main.cpp

//main.cpp
#include "mbed.h"
#include "SMARTWAV.h"

SMARTWAV sWav(p13,p14,p15);    //(TX,RX,Reset);
  
int main(){  
 char playList[100];          //array that stores all the microSD card audio files 
 char folders[100];           //array that stores all the microSD card folders/Dirs 
 char songName[10];           //array that stores the audio file name

 sWav.reset();                //physically reset SMARTWAV
 
 while(1){                       //loop forever
  sWav.playTracks();                //Play any audio track stored on the microSD card root path
  wait(20);                         //let it play some seconds                             
  sWav.pausePlay();                 //Pause track 
  wait(2);                          //let it play some seconds
  sWav.pausePlay();                 //resume track 
  wait(2);                          //let it play some seconds
  sWav.rewindTrack();               //rewind track
  wait(2);                          //let it play some seconds
  sWav.nextTrack();                 //jump to next track
  wait(2);                          //let it play some seconds
  sWav.stopTrack();                 //stop playing track
  sWav.playTrackName("lovers");     //play track named "Lovers" stored on the microSD card
  wait(20);                         //let it play some seconds
  sWav.getFileName(name);           //get current playing song name
  sWav.stopTrack();                 //stop track
  sWav.getFolderList(folders);      //get folder list on microSD card
  sWav.getFileList(playList);       //get audio files/song list on microSD card  
  sWav.setFolder("Rock");           //enter "Rock" folder
  sWav.playTracks();                //Play any audio track stored on the microSD card 0:/Rock/ path
  sWav.playSpeed(TWOX);             //set play speed to 2X
  sWav.continuousPlay(ENABLE);      //enable continuous play
 }
}

Videos

SmartWAV Stand-Alone Module:

SmartWAV MediaPlayer like with mBed

Images and microSD contents could be downloaded from here: http://vizictechnologies.com/#/software-demos-sw/4560115377

Demos & Source Code

To make it simpler, you can import those demos 100% ready to compile and load:

SmartWAV controlled directly from a PC using mbed's USB serial port:

» Import this programSWAVandPCserial

SMARTWAV Audio processor, control the SmartWAV module with communication to a PC via mbed USB Port under an Hyperterminal session 9600/1 stop bit/ no parity/ no flow control

SmartWAV and SmartGPU showing a "windows media player" demo application using mbed:

» Import this programMediaPlayerSWav

SMART WAV audio processor connected together with the SMART GPU graphics processor, a \"windows media player\" application is demostrated, be sure to download demo\'s used files to the microSD card. http://vizictechnologies.com/#/software-demos-sw/4560115377

Work in progress

Notes




calendar Page history
Last modified 13 Feb 2012, by   user Enrique Patrick   tag No tags | 11 comments  

11 comments on SMARTWAV:

27 Feb 2012

Hi.

Well. After much trying I have to say that this program is not working for me.

I originally tried to put my own .wav files on and eventually got it up and running in standalone mode. Then I tried to get it to work with the MBED with no luck. Then I tried to download the source code and example .wav files from the SMARTWAV website. This data did not exist so I emailed them. I was directed to another *pay* link to download the .wav examples. (Evidently they said it cost to much to support the bandwidth.)

I did not download the .wav files but instead used two wav files and renamed them to 'A' and 'B'. The program hangs at "Welcome to the SmartWAV PC Demo! getting microSD contents..." Then it starts to play the songs but hangs. I never return from this function and I am not sure why. If I comment out all of the "getting SD file information" I enter into the While loop and can push and letter only once. It does not return from the function and it hangs.

At this point, I have no idea but am willing to hear of any options.

Thanks.

Steve

27 Feb 2012

And more debugging.....

It would appear that the SmartWav is NOT returning values from the return statements in the example code:

Code

}

unsigned char SMARTWAV::pausePlay(){       //Pause / play song
  _serialSMARTWAV.putc('P');
  return _serialSMARTWAV.getc();    // ***** This never returns because getc() never returns.......
}

As far as I can tell, this happens in all of the routines.
27 Feb 2012

user Steve D wrote:

Hi.

Well. After much trying I have to say that this program is not working for me.

I originally tried to put my own .wav files on and eventually got it up and running in standalone mode. Then I tried to get it to work with the MBED with no luck. Then I tried to download the source code and example .wav files from the SMARTWAV website. This data did not exist so I emailed them. I was directed to another *pay* link to download the .wav examples. (Evidently they said it cost to much to support the bandwidth.)

I did not download the .wav files but instead used two wav files and renamed them to 'A' and 'B'. The program hangs at "Welcome to the SmartWAV PC Demo! getting microSD contents..." Then it starts to play the songs but hangs. I never return from this function and I am not sure why. If I comment out all of the "getting SD file information" I enter into the While loop and can push and letter only once. It does not return from the function and it hangs.

At this point, I have no idea but am willing to hear of any options.

Thanks.

Steve

Hi Steve, actually the mbed download demos are not on the website because they are here!. In the web site and here we can not upload the .wav files due to copyright, they are songs with copyright and we can't distribute them. It's not a matter of bandwith, it's copyright.

We don't sell example projects or code, we sell HARDWARE, the example applications are only for giving you an example of what you can do with this HARDWARE, those examples are provided 100% free, so user must not expect that they work, because he got them for free.

We won't upload code or something that doesn't work, and more than 1000+ people now are using the SmartWAV and no one has complained about that his mbed code doesn't work, maybe the issue could be your mbed, because if you told that your SmartWAV work in stand-alone mode, then of course it must also work in serial mode.

27 Feb 2012

user Steve D wrote:

And more debugging.....

It would appear that the SmartWav is NOT returning values from the return statements in the example code:

Code

}

unsigned char SMARTWAV::pausePlay(){       //Pause / play song
  _serialSMARTWAV.putc('P');
  return _serialSMARTWAV.getc();    // ***** This never returns because getc() never returns.......
}

As far as I can tell, this happens in all of the routines.

All source provided code is always strictly tested before we upload it, and libraries even more, please check your mbed or try with another, this is not a problem of your SmartWAV that doesn't return characters.

28 Feb 2012

Thanks for that.

What I am seeing now is that all commands that I send end with a F for a response. They are NAC.

When running serial program from you guys, I get a A,B, for a song directory (which is correct proving that I am getting two way data communication) however it will not play any songs.

In stand alone mode, it will play on the same SD card.

I'm stumped.

28 Feb 2012

user Steve D wrote:

Thanks for that.

What I am seeing now is that all commands that I send end with a F for a response. They are NAC.

When running serial program from you guys, I get a A,B, for a song directory (which is correct proving that I am getting two way data communication) however it will not play any songs.

In stand alone mode, it will play on the same SD card.

I'm stumped.

Be Sure that when you get the name of your songs, example: you have: "Rock.wav" on your microSD, if you ask for this song name it will be returned as "Rock" without the ".wav", because the SmartWAV only cares on .wav files, any other files will be ignored and won't be listed. So now you must call that song this way: lcd.PlayTrackName("rock");, without the ".wav" extension, so be sure that you correctly call the songs, if you have song names larger than 8 characters, they must be truncated and called "xxxxxx1". Read very very well this section of Play Track Name on the SmartWAV Command Set. If no success then format your microSD card. As we mention before, your SmartWAV and microSD are perfectly working because they play songs in Stand-Alone mode.

29 Feb 2012

I have no idea.

When I write to the system, at 9600 baud, all I get for each command is F.

If I write a 0x41 (A) for status, it tells me that it is OK and is not playing.

If I try to play. I get a response of F. (fail)

In stand alone mode, it works. It is not the card, the formatting, the .wav etc. It plays.

In serial mode, I am communicating. That can be seen by the two way data that is going across.

I should not have to format the card because it plays in standalone mode.

Commands that I write are being acknowledged. I can get contents of file. I can list them. I cannot play.

If tracks come back as found, my files are A.wav and B.wav. When I send a 0X49 and 0X4C the WAV responds with a A,B, 0. When I issue the command 0x54 ('T') it comes back as failed.

I have shown that:

1) There are recognizable .wav files on the system. (Can be shown because it returns their names) 2) My communication is proper. (I can issue a "send me file names" and I get the proper response) 3) It will not play. I have shown this now for a few days. I'm not sure what else to do.

01 Mar 2012

This product is not awesome.

See attached code and output. It does NOT work as advertised. Tried with multiple MBEDS and multiple SWAVs. Serial mode does NOT work.

Code

#include "global.h"


DigitalOut myled(LED1);

int main() {
    wait(1);
    initRS232();
    initInterrupts();
    wait(1);
    RESET = 0;
    wait(1);
    RESET = 1;
    wait(1);  // wait 200ms after reset
 
    pc.printf("\r\n\r\nSWAV going to try to play by writing a 'P'\r\n");
    pc.printf("Going to get list of file names.....\r\n");
    
    Player.putc(0x49);//Get
    wait(0.10);
    Player.putc(0x4C);//file names
    wait(0.10);
    pc.printf("Displays list of valid names. File = AA.wav.\r\n\r\n");
    
    pc.printf("Write command to play any track that can be found 0x54 (T).....");
    Player.putc(0x54);
    wait(0.2);

    pc.printf(" Write command to determine status 0x41 (A).....");
    Player.putc(0x41);
    wait(0.2);

    pc.printf("\r\n Wait 1 second .....\r\n");
    wait(1);
    RESET = 0;
    pc.printf("Drop reset line to 0 for 1 second ..\r\n");    
    wait(1);
    RESET = 1;
    pc.printf("Going to wait for 500ms after reset .\r\n");    
    wait(0.5);  // wait a minimum of 200ms after external reset
    
    pc.printf("Since we are in a known good reset state......going to play any track that can be found 0x54 (T).....");
    Player.putc(0x54);
    wait(0.2);
    
    pc.printf("\r\n\r\n......Surprise, surprise...it communicates but still does not play known files. This is NOT the MBED software. .....\r\n");    
    pc.printf("\r\n\r\nIt also issues a player response even though no command was issued......./r/n");    
    pc.printf("\r\n\r\nThis card plays in standalone mode on this device. ******SERIAL MODE DOES NOT WORK!!!!.......\r\n");        
    wait(2);
    
    while(1) {
    //nothing
    }
}

And the corresponding output......

Code

The PC and SWAV have been set to 9600 N-8-1


SWAV going to try to play by writing a 'P'
Going to get list of file names.....
Player response: A
Player response: A
Player response: ,
Player response:
Player response: O
Displays list of valid names. File = AA.wav.

Write command to play any track that can be found 0x54 (T).....Player response: F
 Write command to determine status 0x41 (A).....Player response:
Player response: O

 Wait 1 second .....
Drop reset line to 0 for 1 second ..
Going to wait for 500ms after reset .
Since we are in a known good reset state......going to play any track that can be found 0x54 (T).....Player response: F


......Surprise, surprise...it communicates but still does not play known files. This is NOT the MBED software. .....


It also issues a player response even though no command was issued......./r/n

This card plays in standalone mode on this device. ******SERIAL MODE DOES NOT WORK!!!!.......
02 Mar 2012

user Steve D wrote:

This product is not awesome.

See attached code and output. It does NOT work as advertised. Tried with multiple MBEDS and multiple SWAVs. Serial mode does NOT work.

And the corresponding output...

Code

The PC and SWAV have been set to 9600 N-8-1

SWAV going to try to play by writing a 'P'
Going to get list of file names.....
Player response: A
Player response: A
Player response: ,
Player response:
Player response: O
Displays list of valid names. File = AA.wav.

Write command to play any track that can be found 0x54 (T).....Player response: F
 Write command to determine status 0x41 (A).....Player response:
Player response: O

 Wait 1 second .....
Drop reset line to 0 for 1 second ..
Going to wait for 500ms after reset .
Since we are in a known good reset state......going to play any track that can be found 0x54 (T).....Player response: F

......Surprise, surprise...it communicates but still does not play known files. This is NOT the MBED software. .....

It also issues a player response even though no command was issued......./r/n

Sir, since you start posting comments on this SmartWAV section, an engineer of Vizic began to re-test the SmartWAV. more than 2000 pieces are now around the World and no one have this problem before, we even don't know if you have more than one SmartWAV to test that is really the SmartWAV the problem.

However, our engineer has done more than 50 tests, and we have discovered something strange, we have two kinds of memory cards for tests, one of 4GB and another of 1GB, both are kingston, the memory card of 4GBs works on any SmartWAV and on Serial and Stand Alone mode without problems. But we have discovered that the 1GBs memory card works on Stand Alone mode also without problems, but in Serial Mode it just lists the songs, but can't play them, it returns('F').

About this issue we even can determine what's the problem, we tested 25 memory cards, and only those of 1GB work only on Stand-Alone mode, so there's not a software Issue of SmartWAV, neither mbed, because they work with any other memory card. It's not even the formatting, it's something strange, maybe memory card's hardware revisions. So now in your case, even you can play songs with Stand-Alone mode, we can almost 100% guarantee that you can't play them(only list them) on Serial Mode due to the microSD card you're using.

As we mentioned before, no one has gone through this issue before, and we discovered it just by doing a lot of tests, no SmartWAV could played songs on those 1GB memory cards of our own, and with another brands and another memory card capacity, no problem was found!

So this issue is present in 1 of each 2000 cases, and it's not the SmartWAV the one of the problem, cause all of this tests we have done. A specifically type of memory card is the problem. Try another memory card and format it with FAT32, then you'll solve all your problems.

07 Mar 2012

Thanks for the input.

My results so far: Hopefully this will assist anyone else that is attempting to use this system.

1) All .WAV files are not created equal. Some files that I have uploaded from the web do not work. However, every file that I have run through iTunes and transferred into a .wav file has worked. Even the files that I downloaded from the web, as a .WAV that did not work, started to work after I passed them through iTunes.

2) Not all memory cards are created equal: I have tested: 3ea of SANDISK 2Gb -> they all failed. I tested on XP/7. Formatted in all versions, quick and long formats. Nothing worked, they still all failed.

The following cards were tested and do work.Lexar 4Gb, Kingston 8Gb, Patriot 16Gb, SANDISK 4Gb.

07 Mar 2012

user Steve D wrote:

Thanks for the input.

My results so far: Hopefully this will assist anyone else that is attempting to use this system.

1) All .WAV files are not created equal. Some files that I have uploaded from the web do not work. However, every file that I have run through iTunes and transferred into a .wav file has worked. Even the files that I downloaded from the web, as a .WAV that did not work, started to work after I passed them through iTunes.

2) Not all memory cards are created equal: I have tested: 3ea of SANDISK 2Gb -> they all failed. I tested on XP/7. Formatted in all versions, quick and long formats. Nothing worked, they still all failed.

The following cards were tested and do work.Lexar 4Gb, Kingston 8Gb, Patriot 16Gb, SANDISK 4Gb.

Thanks a lot for the researching, about the .WAV files, you're right, not all files are created the same, but certainly we recommend in the SmartWAV datasheet to use iTunes because that .WAV files does work :)

About the microSD cards, it's something strange, microSD cards construction, they should be a Standard, but seems that each brand build it's own memory cards according to their specifications.

Thanks again for showing and sharing your results, hope this help all SmartWAV users!

Best Regards!

Please login to post comments.