Cruisers & Sailing Forums (https://www.cruisersforum.com/forums/)
-   OpenCPN (https://www.cruisersforum.com/forums/f134/)
-   -   wav file requirements (https://www.cruisersforum.com/forums/f134/wav-file-requirements-223166.html)

knoekvansoest 30-08-2019 06:55

wav file requirements
 
Hi all,

I am a happy user of opencpn on rpi3b/rpi3b+, recently updated to opencpn 5.0.0 under raspbian buster. Everything up2date.

I use a daisy ais receiver and wanted to replace the standard alert sound (2bells.wav, in /usr/share/opencpn/sounds), that sounds as expected, by something more annoying ;-)

I downloaded some wav's but they either do not play or are distorted when played.

I am not an expert on formats of sound files.

REMARK: I read in the wiki (https://opencpn.org/wiki/dokuwiki/do...ms_work_on_rpi) that wav files to be played from opencpn should be mono 16 bit 22050Hz ... but aplay (command line tool for playing wav files) tells me the following about 2bells.wav:
Playing WAVE '/usr/share/opencpn/sounds/2bells.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono..... I guess the 22050 Hz in the faq is outdated!?!?

Using an online converter, I converted a wav of my choice to the same format as 2bells.wav, which was succesful according to aplay (identical wav properties); furthermore, aplaying my new wav sounds as expected; however it does not play at all in opencpn.....

QUESTION: is there more to wav files than mono/stereo, 8/16 bit and frequency?? Any help appreciated!

regards knoek van soest

Bill O 30-08-2019 07:56

Re: wav file requirements
 
We tried those changes to the wav files (16 bit, mono 22050 Hz) and it didn't work when we wanted different warning noises in Watchdog. The one and two bells sounds were formatted this way, but there is a better way.

I believe the mpg123 driver is already formatted on the pi and you could use that or upload the mplayer driver [ sudo apt install mplayer ] Then when you configure a new alarm (i.e. anchor), click off the sound (box) and click on the command (box). In the command line, put in driver and file location. For example, mplayer /[full path name] . Need to set up each alarm this way.

We used the list of alarms embedded plotter (mp3) but you can create any for these. If you have plotter the location of the list of alarms is in the startup tab and you can browse the list of mp3 sound files under there (if you wanted an alarm when plotter started).

Took us awhile to get the right info on how to set this up correctly.


Bill O.

disputin 30-08-2019 10:45

Re: wav file requirements
 
There are two Linux tools that can help you out.

1. mediainfo - this package can provide detailed information about audio and video files. Run this one the original file and record what the file encoding parameters are.

2. audacity - this will allow you to reencode, or modify your wav file with a very nice graphical front end. There may be other command-line ways of doing this too with ffmpeg, but there is probably a steeper learning curve. Use this to create a new file from your existing file, with the parameters found on step 1.

Good luck,

Sean

knoekvansoest 06-09-2019 05:20

Re: wav file requirements
 
Quote:

Originally Posted by Bill O (Post 2965907)
We tried those changes to the wav files (16 bit, mono 22050 Hz) and it didn't work when we wanted different warning noises in Watchdog. The one and two bells sounds were formatted this way, but there is a better way.

I believe the mpg123 driver is already formatted on the pi and you could use that or upload the mplayer driver [ sudo apt install mplayer ] Then when you configure a new alarm (i.e. anchor), click off the sound (box) and click on the command (box). In the command line, put in driver and file location. For example, mplayer /[full path name] . Need to set up each alarm this way.

We used the list of alarms embedded plotter (mp3) but you can create any for these. If you have plotter the location of the list of alarms is in the startup tab and you can browse the list of mp3 sound files under there (if you wanted an alarm when plotter started).

Took us awhile to get the right info on how to set this up correctly.


Bill O.

hello Bill, thanks for thinking along; never noticed the option in watchdog to replace "sound" (wav file) by "command", this is a useful option for sure! Unfortunately, my question was related to ais alarms and not watchdog alarms, and unfortunately in ais alarms a similar option to define an alarm "command" does not exist. Perhaps a good idea to suggest to the developers to structure the ais alarm setup along similar lines as the watchdog alarms in a future version of opencpn!

regards knoek van soest

knoekvansoest 06-09-2019 05:53

Re: wav file requirements
 
Quote:

Originally Posted by disputin (Post 2966062)
There are two Linux tools that can help you out.

1. mediainfo - this package can provide detailed information about audio and video files. Run this one the original file and record what the file encoding parameters are.

2. audacity - this will allow you to reencode, or modify your wav file with a very nice graphical front end. There may be other command-line ways of doing this too with ffmpeg, but there is probably a steeper learning curve. Use this to create a new file from your existing file, with the parameters found on step 1.

Good luck,

Sean

Hello Sean,

thanks for your reply. As was in my original post, I was already aware of wav file properties of the original 1bells.wav and 2bells.wav. I have reconfirmed these properties using another tool (audioinfo, standard matlab command), just to be sure. So I am now 100% certain that the 1bells.wav and 2bells.wav that are part of rpi opencpn by default are uncompressed 1 channel, 16 bit, 44100 hz sample frequency (btw and as noted before, this is inconsistent with the wiki). And I am also 100% sure that all these properties are identical in my new wav file.

Just to be clear, this new wav file plays ok from any music/sound player outside of opencpn, both on pc and on rpi; and I can select it as ais alarm sound in opencpn (I stored it in the same folder where the ?bell.wav files are); however, in opencpn it does not play at all ....

Any other ideas on this??

regards knoek van soest

conachair 06-09-2019 06:10

Re: wav file requirements
 
Not much help, but for audio file fiddling SOX is pretty good >>
SoX - Sound eXchange | HomePage

Bill O 06-09-2019 06:22

Re: wav file requirements
 
Quote:

Originally Posted by knoekvansoest (Post 2970402)
hello Bill, thanks for thinking along; never noticed the option in watchdog to replace "sound" (wav file) by "command", this is a useful option for sure! Unfortunately, my question was related to ais alarms and not watchdog alarms, and unfortunately in ais alarms a similar option to define an alarm "command" does not exist. Perhaps a good idea to suggest to the developers to structure the ais alarm setup along similar lines as the watchdog alarms in a future version of opencpn!

regards knoek van soest


Just went through the process of playing w/the watchdog sounds so I was assuming it was similar in the AIS sounds. OK, now I see exactly what you are saying w/the AIS targets and totally agree w/the addition of the command line here also. The 1 and 2 bell files just don't cut it.
I was only able to get garbled sounds when I changed over the wav files to the "proper format". This task was very frustrating for such a simple item and different sound files are needed. It is very difficult sometimes to hear the bell sounds when better alert sound files are available.


Bill O.

Bill O 06-09-2019 06:27

Re: wav file requirements
 
Quote:

Originally Posted by conachair (Post 2970443)
Not much help, but for audio file fiddling SOX is pretty good >>
SoX - Sound eXchange | HomePage


Do you know who is in charge of possibly adding a command to the AIS feature like in Watchdog. Sean D'Epagnier did an excellent job tweaking the Watchdog plugin and agree that a command line to insert other alert sounds should be added to the AIS targets to make it more useful.


Bill O.

Andreas29 07-09-2019 03:03

Re: wav file requirements
 
Hi,

I made the experience that since april/may the original os (rasbian Stretch) changed in that way that I can´t play sound in oc.
I use hdmi or the Audio jack to bring the sound out no usb-soundcard or something like this.

Last Weekend I investigated this once more. It seems that there´s an issue with the sounddrivers of the os (Stretch) for the pi in combination with opencpn.

With an older os-version (older than April/may) I can play the sound files.

I changed the sampling rates and other things but this had no effect. The prob is, imho, that there´s now an audio driver in the os of the pi witch is not supported by OC.

My threat with the Audio probs look here: https://www.cruisersforum.com/forums/...io-218897.html

In the moment I use the older OS for the pi without doing an update/upgrade :rolleyes:

I´m not the pi-profi but in the moment I think there´s a prob with the alsa-mixer / player witch is not supported in OC.
It have something to do with changes in the kernel of the pi´s OS in April/may.
When doing a rpi-update I get sound probs.
Normally you can easy switch back after rpi-update to the previos Version and than all worked fine.
But when doing an update/upgrade the way of undoing a rpi-update doesn´t work and you´ll get sound probs.

If someone have sugestions how to get the right alsa-player back to work...tell it please.
Or is it possible to install an other soundplayer and tell oc to use this.

Regards

Andreas


All times are GMT -7. The time now is 19:16.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.


ShowCase vBulletin Plugins by Drive Thru Online, Inc.