Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/audiocfg Create a waveform in hardware native sample...



details:   https://anonhg.NetBSD.org/src/rev/a291313f92ff
branches:  trunk
changeset: 459112:a291313f92ff
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Aug 24 06:32:25 2019 +0000

description:
Create a waveform in hardware native sample rate which is more efficient.

diffstat:

 usr.bin/audiocfg/audiodev.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r ff4687b5219e -r a291313f92ff usr.bin/audiocfg/audiodev.c
--- a/usr.bin/audiocfg/audiodev.c       Sat Aug 24 06:16:27 2019 +0000
+++ b/usr.bin/audiocfg/audiodev.c       Sat Aug 24 06:32:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audiodev.c,v 1.13 2019/08/24 06:16:27 isaki Exp $ */
+/* $NetBSD: audiodev.c,v 1.14 2019/08/24 06:32:25 isaki Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -51,8 +51,6 @@
     TAILQ_HEAD_INITIALIZER(audiodevlist);
 static unsigned int maxunit;
 
-#define AUDIODEV_SAMPLE_RATE   44100
-
 static int
 audiodev_getinfo(struct audiodev *adev)
 {
@@ -308,7 +306,7 @@
        }
 
        AUDIO_INITINFO(&info);
-       info.play.sample_rate = AUDIODEV_SAMPLE_RATE;
+       info.play.sample_rate = adev->hwinfo.play.sample_rate;
        info.play.channels = adev->hwinfo.play.channels;
        info.play.precision = 16;
        info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
@@ -347,7 +345,7 @@
 
        rv = -1;
 
-       dtmf_new(&buf, &buflen, info->play.sample_rate, 2,
+       dtmf_new(&buf, &buflen, adev->hwinfo.play.sample_rate, 2,
            adev->hwinfo.play.channels, chanmask, 350.0, 440.0);
        if (buf == NULL) {
                return -1;



Home | Main Index | Thread Index | Old Index