Upload test.py
Browse files
test.py
CHANGED
|
@@ -78,7 +78,7 @@ def greedy_decoder(output, vocab):
|
|
| 78 |
def record_audio(duration, fs, filename):
|
| 79 |
print(f"\nRECORDING... ({duration} s)")
|
| 80 |
try:
|
| 81 |
-
recording = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='float32')
|
| 82 |
sd.wait()
|
| 83 |
print("Recording finished.")
|
| 84 |
wav.write(filename, fs, (recording * 32767).astype(np.int16))
|
|
|
|
| 78 |
def record_audio(duration, fs, filename):
|
| 79 |
print(f"\nRECORDING... ({duration} s)")
|
| 80 |
try:
|
| 81 |
+
recording = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='float32', device=2)
|
| 82 |
sd.wait()
|
| 83 |
print("Recording finished.")
|
| 84 |
wav.write(filename, fs, (recording * 32767).astype(np.int16))
|