Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

类型错误问题 #12

Open
pandaGst opened this issue Jun 21, 2021 · 1 comment
Open

类型错误问题 #12

pandaGst opened this issue Jun 21, 2021 · 1 comment

Comments

@pandaGst
Copy link

after build the package, I run the code from Useage,then got a TypError:

TypeError: in method 'AudioProcessingModule_process_stream', argument 2 of type 'std::string const &'

Anyone can help me?

@RicardoRagel
Copy link

Hello!

I got the same issue using python 3. Try using this modified version of the example:

# !/usr/bin/env python3
from webrtc_audio_processing import AudioProcessingModule as AP
import numpy as np

ap = AP(enable_vad=True, enable_ns=True)
ap.set_stream_format(16000, 1)      # set sample rate and channels
ap.set_ns_level(1)                  # NS level from 0 to 3
ap.set_vad_level(1)                 # VAD level from 0 to 3

audio_10ms_array = np.zeros(160, dtype=np.int16)

# only support processing 10ms audio data each time
audio_out = ap.process_stream(audio_10ms_array.astype(np.int16).tostring())

print('voice: {}'.format(ap.has_voice()))

I don't usually program in python, so perhaps it is not the more direct way to achive the argument as string, but I hope it works also for you.

Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants