Hello, I have a 4 port analog card I am using for proof of concept testing. I was wondering what the DSAPI.SetSamplingRate() method does as it seems to have no effect. I have read the API and Component documentation, Component has a similar In/Out sampling rate methods. I am trying to play and record wave files with 8 Bit, 44100Hz sampling resolution and rate. (I know over Telco/POTS 4KHz is the bandwidth and 8KHz is enough, but I am not using the card in a standard Telco application.) I was able to code simple IRV with the Component and low level API very easily if I use 8 Bit 8KHz wave files but I need 8 or 16 Bit @ 44100 Hz. Any help or code examples would be greatly appreciated. PS: I have a media card with 4 dedicated DSPs.)
The Diva cards connect to sandard telco lines using 8khz rates. SetSamplingRate() is designed to adapt this rate to a stream or record that is at a different rate, eg when streaming ADPCM files at 6Khz. However the Diva API only supports certain audio formats for file or memory based streaming, these formats are listed in the DivaAPI.pdf and do not include 44.1Khz formats.
Of course there is no advantage to using 44.1Khz files with telephony as the line rate is 8Khz so that is the maximum 'quality' you can achieve.
Vick, thank you for your reply. I have two questions now.
First, the Diva API document has an enumeration for DivaSamplingRate in which it lists Min, Normal, and Maximum rates. They are 1250, 8000, and 51200 for the Diva Media Boards. We bought the card, and possibly many more, based on the premise that we could sample at up to 51200. If it is not file or streaming rates what "sampling rate" does it refer to? (We use higher sampling rates to record files for telco diagnostics. The higher sampling rates expose noise, spikes etc. that may be on the line.)
Second question, I started to test at 8Bit 8Khz wave and again my application had no problems sending and receiving at this bit rate but something did not sound right. I connected an oscilloscope at the receiving end of the call, the Dialogic card is the caller, and played a wave file that is a 10 second 2000Hz "test tone". I observed a very quick, and large, reduction in amplitude of the sine wave about half a second in to the call. The wave file itself has a constant amplitude as observed with a wave editor application and scoped coming out of a sound card. Is there an AGC (Automatic Gain Control) or something in the Dialogic card that may cause this? If so how do I shut it off. Note I tried this test with all three volume options provided in the API and all volumes settings have the same result. I did eliminate the phone line as a cause by generating a single tone via the DSAPI and the amplitude remained constant. (I would use the DSAPI call for tone generation but it's timing is not accurate enough, I need minimum of 10 mS (milliseconds) on/off duty cycle for my requirements.)
Thank you again for your support.
The sampling rate is the rate that the api will convert the native 8Khz line information to or from. So if you are recording a file and set the sampling rate to 16khz you will basically get a wav file that has the original audio at half speed as the original information is always at 8khz. So you won't get any increase in quality as you are effectively 'resampling' the original line audio. The wav header is not changed to reflect the new sampling rate btw so you need to listen to the file to hear the difference.
Re the playing of your test file, there are legal limits to the energy that we can send onto the wire so its quite likely that this is why the amplitude was clamped. You can sometimes switch this off with a special tool but it can't be used on telco lines so the better solution would be to reduce the amplitude of your signal. There is also AGC on the card which is controlled by the Diva configuration manager.
I'd suggest that you get in touch with your local Dialogic office and talk to them about your requirements as we have worked on similar projects in the past and if they were large enough have enabled access to the lower level features on the cards so that the audio handling can be fine-tuned.
Vic, Thanx again for your help. I reduced the wave file amplitude and I am now getting a clean playback and will look into the AGC option. I am also going to look into tonal generation from the card again as this weekend I realized my threading model was not playing nice with the DSAPI, my fault.
I am aware of the energy limitation on POTS lines. My design will not be used on public POTS networks so the legalities do not apply. You mention a special tool to shut off energy limiting, who do I need to contact to get a copy of this tool? (To have a constant high energy level output from the card would be the best option for me. I generate wave files/streams dynamically in my code so I adjust levels programmatically.)
Thanks again and take care.
db
Good to hear the file is playing better now. The card tone generators are very flexible so hopefully can do what you want, if you need to generate tones with very small mark/space granularity we might be able to 'preload' a tone definition, I had discussions about this with one of the board engineers a while back.
The tool you need is called mantool.exe. If you contact your local Dialogic office and have a word with one of the techincal presales (if you are in the UK that will be me ) they can talk to you about your requirements in more detail.
I know with the ISDN cards we have power limiters and the same options and more are visible in the analog card control interface ("Config\Layer1" in mantool btw) so it looks like there is scope for tweaking stuff.