Module Name:    src
Committed By:   isaki
Date:           Sat Aug 24 06:32:25 UTC 2019

Modified Files:
        src/usr.bin/audiocfg: audiodev.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/audiocfg/audiodev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/audiocfg/audiodev.c
diff -u src/usr.bin/audiocfg/audiodev.c:1.13 src/usr.bin/audiocfg/audiodev.c:1.14
--- src/usr.bin/audiocfg/audiodev.c:1.13	Sat Aug 24 06:16:27 2019
+++ src/usr.bin/audiocfg/audiodev.c	Sat Aug 24 06:32:25 2019
@@ -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 <jmcne...@invisible.ca>
@@ -51,8 +51,6 @@ static TAILQ_HEAD(audiodevhead, audiodev
     TAILQ_HEAD_INITIALIZER(audiodevlist);
 static unsigned int maxunit;
 
-#define AUDIODEV_SAMPLE_RATE	44100
-
 static int
 audiodev_getinfo(struct audiodev *adev)
 {
@@ -308,7 +306,7 @@ audiodev_test(struct audiodev *adev)
 	}
 
 	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 @@ audiodev_test_chmask(struct audiodev *ad
 
 	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;

Reply via email to