mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore previous output after recording
This commit is contained in:
parent
a63c21dbfb
commit
bfe4260897
@ -300,6 +300,7 @@ Voice_create_recording_wav(Voice *self, PyObject *args) {
|
|||||||
hr = self->voice->Speak(text.ptr(), SPF_DEFAULT, NULL);
|
hr = self->voice->Speak(text.ptr(), SPF_DEFAULT, NULL);
|
||||||
Py_END_ALLOW_THREADS;
|
Py_END_ALLOW_THREADS;
|
||||||
stream->Close();
|
stream->Close();
|
||||||
|
self->voice->SetOutput(uses_default_output ? NULL: token, TRUE);
|
||||||
if (FAILED(hr)) return error_from_hresult(hr, "Failed to speak into wav file", PyTuple_GET_ITEM(args, 0));
|
if (FAILED(hr)) return error_from_hresult(hr, "Failed to speak into wav file", PyTuple_GET_ITEM(args, 0));
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ def find_tests():
|
|||||||
self.assertEqual(self.sapi.get_current_volume(), new_vol)
|
self.assertEqual(self.sapi.get_current_volume(), new_vol)
|
||||||
self.sapi.set_current_volume(dv)
|
self.sapi.set_current_volume(dv)
|
||||||
|
|
||||||
def test_record_as_wav(self):
|
def test_record_as_audio_file(self):
|
||||||
import tempfile
|
import tempfile
|
||||||
with tempfile.TemporaryDirectory() as tdir:
|
with tempfile.TemporaryDirectory() as tdir:
|
||||||
wav_path = os.path.join(tdir, 'test.wav')
|
wav_path = os.path.join(tdir, 'test.wav')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user