User Tools

Site Tools


users:dagnall53:sound

Go back to The WiRocS Sound System

Uploading Sound Files

Sound Files can be uploaded either using the Arduino "sketch Data upload", or, much more conveniently, can be uploaded over the air using a program like FileZilla. To use this, you will need the WiRocS node up and running, and connected to the network. Each WiRocS node will have its own IP address, and you need to know this. If you monitor the Serial port when the Node is powered up, it will (among other information) show what IP address it has been allocated: for example: " Connected to SSID:linksys-25 IP:192.168.0.35 " (it will also show what RocNet Node it is set to, and this can be set and reset using the standard RocNet programming interface.)

Then, in FileZilla, open the site manager, and set up a Site as follows: Protocol FTP. Host 192.168.0.35 logon Normal user esp8266 Password esp8266. In Transfer settings, set "limit number of connections" to 1. Then "connect". You will get a view of a local data file and of the WiRocS files on the right. Just click and drag files to transfer them.


SPIFFS SIZE

The ESP8266 can be set for 1M 2M or 3M SPIFFS. I used 3M extensively with early versions of the software, but at V15, the binary got too large to upload via OTA. So for versions after V15 I recommend setting the SPIFFS to "2M", this is still plenty big enough for lots of sounds, but OTA works again.

The ESP32 arduino system does not have the same SPIFFS size options although there are discussions about this on the forums. The ESP32 code therefore only has a 1M SPIFFS. The example wav files in the data directory should fit, but only just!


File Formats

The Audio code will accept any bit-rate '.wav files. I have tested with 8khz and 11kHz files. The samples in the Data directory should all be 11Khz to prevent possible issues if the code tries to play two different bit-rates at the same time.

I used Audacity to edit and convert the files to mono.


Known Issues

Playing at "wrong speed"

The Audio system cannot cope with sound samples of different bitrates being played at the same time. If you attempt this, BOTH samples will play at the bit rate of the LAST selected sound sample. - Of course, you might like this effect!.

Buzzing after sounds finish playing

The Wav files seem to need about 160ms of "silence" at the end of each wav file in order for the audio to go quiet after they have finished. You can modify sound files using Audacity to add "silence" at the end of any clip. Also I would recommend that the sounds "fade out".

FTP

FTP seems to occasionally have trouble sending larger files when MQTT is working. As a work around, there is a hidden function in the Serial WIFi SSID select/password set interface (V16 on). When you have got to the point where the Serial WiFi SSID/password interface asks for sss to save or rrr to retry, type ftp. The node will then enter a "dead end" where it logs onto WiFi using the set values, and starts FTP, BUT does not do any MQTT. This seems to allow FTP transfers much more reliably. When you have uploaded the files you want, reset the Node by using the reset, or power off.

users/dagnall53/sound.txt · Last modified: 2019/03/21 17:48 by dagnall53