Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 08:24:02 +0000



WAV file trouble, bitrates/encoding?

View Count: 789

[2021-09-07 22:31:52]
silvereagle - Posts: 23
hi friends,

I'm experiencing trouble with some wav files I want to use in my advanced custom study with sc.PlaySound.

Troubleshooting Steps:

1. Using General Settings > Alerts/General 3 I can successfully test/play/hear default sierra wav files (airplane.wav, applause.wav, etc)

2. I can also use these default sounds from within my study with sc.PlaySound.

3. I downloaded from the internet some different wav files, like buzzer sounds (for a stop) and cash register (for a target). Some will play in the Alerts/General 3 tab and some will not ---and furthermore, those that do play in the test tab have this weird delay where it seems to cut off the first half-second or so of the audio so it sounds like I only get half a "ka-ching" for a target. bizarre.

So, 1. I don't know why some wav files play, while others do not and 2. I don't know why some that play, only seem to play half the audio file.

My suspicions are that Sierra is particular about what wav files it uses and what I'm trying to use is not either in a particular format/bitrate or a different encoding. I used Audacity (an open source audio program to try and see what WAV files Sierra likes, but so far no dice in figuring this out)

WAV files can have a number of formats/bitrates:

8 kHz, 8 Bit, Mono
8 kHz, 8 Bit, Stereo
8 kHz, 16 Bit, Mono
8 kHz, 16 Bit, Stereo
16 kHz, 8 Bit, Mono
16 kHz, 8 Bit, Stereo
16 kHz, 16 Bit, Mono
16 kHz, 16 Bit, Stereo
etc...

AND WAV files can be encoded a number of different ways.

WAV (Microsoft)
Signed 16-bit PCM
Signed 24-bit PCM
Signed 32-bit PCM
Unsigned 8-bit PCM
32-bit float
64-bit float
U-law
A-law
IMA ADPCM
Microsoft ADPCM
GSM 6.10
32Kbs G721 ADPCM
16kbs NMS ADPCM
24kbs NMS ADPCM
32kbs NMS ADPCM

Audacity has an export function which should be able to convert my sounds into something Sierra likes, but I'm not sure what Sierra will like. Anyone out there know the format/bitrate and or encoding that makes Sierra happy?

Thanks!
[2021-09-07 23:02:29]
Sierra Chart Engineering - Posts: 104368
This is not dependent on Sierra Chart at all. It strictly depends upon what the operating system requires since Sierra Chart uses the operating system to play the files.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-09-08 00:49:49]
silvereagle - Posts: 23
Not trying to poke the bear here, but there does seem to be some sort of discrepancy / difference between the WAV files.

Using the Windows Media Player on the box, I can play/hear the airplane.wav file [good]
Using Sierra Charts wav testing tab, I can play/hear the airplane.wav file [good]

Using Windows Media Player, I can play/hear one my other custom wav files (target filled) [good]
Using Sierra Charts wav testing tab, I just get the default Microsoft "beep" sound, that indicates something went wrong trying to play that wav file [not good]

Why does one WAV file play on the Sierra test tab, and not the other ---when both will play in Windows Media Player?

So, that's regarding the testing tab ---but I think something similar happens in the code as well.

As a corollary, it does seem that when I wire up the sounds included with sierra (airplane, applause, etc) sc.PlaySound(path/to/wavfile, 1) works fine playing those default sounds from the custom study. But when I wire those up to my other wav files, I will either get the "beep" which indicates a problem playing the wav file, or I might get a half played wav file. My imagination isn't rich enough to make any of this up. I gotta be missing something. I did find some documentation ---got excited for a second--- but it looks dead.

https://www.sierrachart.com/SamplingSoundFiles

But, this leads me to believe not all WAV files are created equal so to say, and back to how to create a wav file that Sierra is happy with.

Thanks for not dismissing me out of hand.
[2021-09-08 03:28:36]
silvereagle - Posts: 23
UPDATE

Tonight I wrote a cpp program that plays a sound file. In your previous post you said the os plays the file so I'm guessing Sierra is using PlaySound.

The program.

#include <iostream>
#include <Windows.h>

int main()
{
PlaySound(TEXT("ls2.wav"), NULL, SND_FILENAME);
std::cout << "press any key\n";
}

This program works, and plays my custom wav file. When I try and play this same wav file on the General Settings > Alerts / General 3, it does not work and all I hear is the default os "beep" that it could not play the file.
This program plays your airplane.wav just fine too.

So I'm not sure why Sierra does not seem to like some wav files and not others.

Thoughts?
[2021-09-08 06:27:34]
Sierra Chart Engineering - Posts: 104368
so I'm guessing Sierra is using PlaySound.
Yes this is correct.

Try using these flags:
SND_ASYNC

and:
SND_ASYNC | SND_NOSTOP



So I'm not sure why Sierra does not seem to like some wav files and not others.
It does not matter to Sierra Chart.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-09-09 04:10:40]
silvereagle - Posts: 23
hello friend,

I think I figured it out tonight. What I found is this:

1. The standard audio alerts are in C:\SierraChart2268\AlertSounds
2. I had created a subdirectory called MySounds under the AlertSounds directory for my custom wavs
3. Using the testing tool, I had trouble playing sounds housed in the AlertSounds\MySounds directory
3.a. The testing tool allows one to browse to a file on disk to play it, but, they would not play for some reason when housed in the MySounds subdirectory. dunno why.
4. When I moved my wav files out of the subdirectory to the AlertSounds directory (where airplane and applause all work), the testing tool worked on my wavs and using sc.PlaySound in my advanced custom study worked as expected.

So, there was something about housing my wav files in a subdirectory under AlertSounds that seemed to be causing the strange issues.
Thanks for bearing with me, and hope this helps someone else one day.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account