Is there Sampling rate conversion CPU penalty?
Hi, I am streaming a wav file who’s sampling rate is 44100 and FreeSWITCH says sample rate 44100 doesn't match requested rate 8000. So I think it’s doing the conversion here. If so, is there any CPU performance penalty while doing the conversion? What’s the best practice here should I change the sampling rate of the file or just leave it like that? -- Sent with Airmail
Hey, The best practice is to transcode your wave files to the diferent rates your clients use If your clients are only on pstn side, 8khz should be enough If your clients is on sip side, better to generate 8, 16,32, and 48khz (mono) files Converting rate is a cpu intencive task and its part of transcoding, so its not recomanded... Thanks. Envoyé de mon iPad
Le 28 juil. 2017 à 20:24, Muhammad Naseer Bhatti <nbhatti@gmail.com> a écrit :
Hi, I am streaming a wav file who’s sampling rate is 44100 and FreeSWITCH says sample rate 44100 doesn't match requested rate 8000. So I think it’s doing the conversion here. If so, is there any CPU performance penalty while doing the conversion? What’s the best practice here should I change the sampling rate of the file or just leave it like that?
--
Sent with Airmail _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Pro tip: If the file path is /var/sounds/example.wav you can create /var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav And it will auto-select the correct one that matches the sample rate of that call. On Fri, Jul 28, 2017 at 2:53 PM, Tayeb Meftah <tayeb.meftah@gmail.com> wrote:
Hey, The best practice is to transcode your wave files to the diferent rates your clients use If your clients are only on pstn side, 8khz should be enough If your clients is on sip side, better to generate 8, 16,32, and 48khz (mono) files Converting rate is a cpu intencive task and its part of transcoding, so its not recomanded... Thanks.
Envoyé de mon iPad
Le 28 juil. 2017 à 20:24, Muhammad Naseer Bhatti <nbhatti@gmail.com> a écrit :
Hi, I am streaming a wav file who’s sampling rate is 44100 and FreeSWITCH says sample rate 44100 doesn't match requested rate 8000. So I think it’s doing the conversion here. If so, is there any CPU performance penalty while doing the conversion? What’s the best practice here should I change the sampling rate of the file or just leave it like that?
--
Sent with Airmail
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II ♬ @anthmfs ♬ @FreeSWITCH ♬ ☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞ http://twitter.com/FreeSWITCH ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+ <http://freeswitch.org/g+>* ClueCon Weekly Development Call ☎ sip:888@conference.freeswitch.org ☎ +19193869900 https://www.youtube.com/watch?v=oAxXgyx5jUw https://www.youtube.com/watch?v=9XXgW34t40s https://www.youtube.com/watch?v=NLaDpGQuZDA
Ok Awesome. So the transcoding from one sampling rate to other is expensive and does takes some CPU cycles, correct? -- Sent with Airmail From: Anthony Minessale <anthony.minessale@gmail.com> <anthony.minessale@gmail.com> Reply: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <freeswitch-users@lists.freeswitch.org> Date: July 28, 2017 at 11:03:18 PM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] Is there Sampling rate conversion CPU penalty? Pro tip: If the file path is /var/sounds/example.wav you can create /var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav And it will auto-select the correct one that matches the sample rate of that call. On Fri, Jul 28, 2017 at 2:53 PM, Tayeb Meftah <tayeb.meftah@gmail.com> wrote:
Hey, The best practice is to transcode your wave files to the diferent rates your clients use If your clients are only on pstn side, 8khz should be enough If your clients is on sip side, better to generate 8, 16,32, and 48khz (mono) files Converting rate is a cpu intencive task and its part of transcoding, so its not recomanded... Thanks.
Envoyé de mon iPad
Le 28 juil. 2017 à 20:24, Muhammad Naseer Bhatti <nbhatti@gmail.com> a écrit :
Hi, I am streaming a wav file who’s sampling rate is 44100 and FreeSWITCH says sample rate 44100 doesn't match requested rate 8000. So I think it’s doing the conversion here. If so, is there any CPU performance penalty while doing the conversion? What’s the best practice here should I change the sampling rate of the file or just leave it like that?
--
Sent with Airmail
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II ♬ @anthmfs ♬ @FreeSWITCH ♬ ☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞ http://twitter.com/FreeSWITCH ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+ <http://freeswitch.org/g+>* ClueCon Weekly Development Call ☎ sip:888@conference.freeswitch.org ☎ +19193869900 https://www.youtube.com/watch?v=oAxXgyx5jUw https://www.youtube.com/watch?v=9XXgW34t40s https://www.youtube.com/watch?v=NLaDpGQuZDA _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Compared to not having to, its certainly more cpu intensive, not so much compared to video transcoding. Depending on the rates involved its probably less expensive than g729 or opus transcoding, more so than g711 transcoding.
On Jul 28, 2017, at 5:45 PM, Muhammad Naseer Bhatti <nbhatti@gmail.com> wrote:
Ok Awesome. So the transcoding from one sampling rate to other is expensive and does takes some CPU cycles, correct?
From: Anthony Minessale <anthony.minessale@gmail.com> <mailto:anthony.minessale@gmail.com> Reply: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <mailto:freeswitch-users@lists.freeswitch.org> Date: July 28, 2017 at 11:03:18 PM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> <mailto:freeswitch-users@lists.freeswitch.org> Subject: Re: [Freeswitch-users] Is there Sampling rate conversion CPU penalty?
Pro tip:
If the file path is /var/sounds/example.wav
you can create
/var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav
And it will auto-select the correct one that matches the sample rate of that call.
On Fri, Jul 28, 2017 at 2:53 PM, Tayeb Meftah <tayeb.meftah@gmail.com <mailto:tayeb.meftah@gmail.com>> wrote: Hey, The best practice is to transcode your wave files to the diferent rates your clients use If your clients are only on pstn side, 8khz should be enough If your clients is on sip side, better to generate 8, 16,32, and 48khz (mono) files Converting rate is a cpu intencive task and its part of transcoding, so its not recomanded... Thanks.
Envoyé de mon iPad
Le 28 juil. 2017 à 20:24, Muhammad Naseer Bhatti <nbhatti@gmail.com <mailto:nbhatti@gmail.com>> a écrit :
Hi, I am streaming a wav file who’s sampling rate is 44100 and FreeSWITCH says sample rate 44100 doesn't match requested rate 8000. So I think it’s doing the conversion here. If so, is there any CPU performance penalty while doing the conversion? What’s the best practice here should I change the sampling rate of the file or just leave it like that?
On 28 July 2017 at 13:00, Anthony Minessale <anthony.minessale@gmail.com> wrote:
Pro tip:
If the file path is /var/sounds/example.wav
you can create
/var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav
And it will auto-select the correct one that matches the sample rate of that call.
Yes, a great tip! Also, you might need to normalize the audio. Michael pointed me in the right direction on this earlier in the week and it made a big difference on some of my audio files. This is this script freeswitch uses for MOH and the audio files: https://freeswitch.org/stash/projects/FS/repos/freeswitch-sounds/browse/dist... Check out these lines: https://freeswitch.org/stash/projects/FS/repos/freeswitch-sounds/browse/dist... https://freeswitch.org/stash/projects/FS/repos/freeswitch-sounds/browse/dist...
Isn't this what mod_native_file does? On Fri, Jul 28, 2017 at 6:53 PM, jungle Boogie <jungleboogie0@gmail.com> wrote:
On 28 July 2017 at 13:00, Anthony Minessale <anthony.minessale@gmail.com> wrote:
Pro tip:
If the file path is /var/sounds/example.wav
you can create
/var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav
And it will auto-select the correct one that matches the sample rate of
that call.
Yes, a great tip!
Also, you might need to normalize the audio. Michael pointed me in the right direction on this earlier in the week and it made a big difference on some of my audio files.
This is this script freeswitch uses for MOH and the audio files: https://freeswitch.org/stash/projects/FS/repos/freeswitch- sounds/browse/dist.pl
Check out these lines: https://freeswitch.org/stash/projects/FS/repos/freeswitch- sounds/browse/dist.pl#82 https://freeswitch.org/stash/projects/FS/repos/freeswitch- sounds/browse/dist.pl#112
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Guillermo Ruiz Camauer
mod_native file is different. It only supports raw formats of non VBR codes. If you specify a path with no extension, the codec in use will be substituted, and if it doesn't exist, it will not work. On Fri, Jul 28, 2017 at 5:13 PM, Guillermo Ruiz Camauer <grcamauer@gmail.com
wrote:
Isn't this what mod_native_file does?
On Fri, Jul 28, 2017 at 6:53 PM, jungle Boogie <jungleboogie0@gmail.com> wrote:
On 28 July 2017 at 13:00, Anthony Minessale <anthony.minessale@gmail.com> wrote:
Pro tip:
If the file path is /var/sounds/example.wav
you can create
/var/sounds/8000/example.wav /var/sounds/16000/example.wav /var/sounds/32000/example.wav /var/sounds/48000/example.wav
And it will auto-select the correct one that matches the sample rate of
that call.
Yes, a great tip!
Also, you might need to normalize the audio. Michael pointed me in the right direction on this earlier in the week and it made a big difference on some of my audio files.
This is this script freeswitch uses for MOH and the audio files: https://freeswitch.org/stash/projects/FS/repos/freeswitch-so unds/browse/dist.pl
Check out these lines: https://freeswitch.org/stash/projects/FS/repos/freeswitch-so unds/browse/dist.pl#82 https://freeswitch.org/stash/projects/FS/repos/freeswitch-so unds/browse/dist.pl#112
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Guillermo Ruiz Camauer
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II ♬ @anthmfs ♬ @FreeSWITCH ♬ ☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞ http://twitter.com/FreeSWITCH ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+ <http://freeswitch.org/g+>* ClueCon Weekly Development Call ☎ sip:888@conference.freeswitch.org ☎ +19193869900 https://www.youtube.com/watch?v=oAxXgyx5jUw https://www.youtube.com/watch?v=9XXgW34t40s https://www.youtube.com/watch?v=NLaDpGQuZDA
participants (6)
-
Anthony Minessale
-
Guillermo Ruiz Camauer
-
jungle Boogie
-
Michael Jerris
-
Muhammad Naseer Bhatti
-
Tayeb Meftah