-
Notifications
You must be signed in to change notification settings - Fork 496
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
TypeError: object of type 'NoneType' has no len() #255
Comments
you need to implement "def get_next_audio_frame()" yourself for you platform. it is returning nothing now. |
I think the SDK python README should have at least a workable example that everybody can use/edit easily.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Mycode :
import sys
import soundfile
import os
import pyaudio
sys.path.append(r'C:\Users\Mashud A Talukdar\AppData\Local\Programs\Python\Python36\Lib\site-packages\porcupine\binding\python')
from porcupine import Porcupine
library_path= 'C:\Users\Mashud A Talukdar\AppData\Local\Programs\Python\Python36\Lib\site-packages\porcupine\lib\windows\amd64\libpv_porcupine.dll'
model_file_path='C:\Users\Mashud A Talukdar\AppData\Local\Programs\Python\Python36\Lib\site-packages\porcupine\lib\common\porcupine_params.pv'
keyword_file_paths=['C:\Users\Mashud A Talukdar\AppData\Local\Programs\Python\Python36\Lib\site-packages\porcupine\resources\keyword_files\windows\alexa_windows.ppn']
sensitivities=[0.5]
handle = Porcupine(library_path, model_file_path, keyword_file_paths=keyword_file_paths, sensitivities=sensitivities)
def get_next_audio_frame():
pass
while True:
pcm = get_next_audio_frame()
keyword_index = handle.process(pcm)
if keyword_index >= 0:
# detection event logic/callback
pass
output :
File "c:/Users/Mashud A Talukdar/Desktop/Python/test.py", line 18, in
keyword_index = handle.process(pcm)
File "C:\Users\Mashud A Talukdar\AppData\Local\Programs\Python\Python36\lib\site-packages\porcupine\binding\python\porcupine.py", line 154, in process
status = self.process_func(self._handle, (c_short * len(pcm))(*pcm), byref(result))
TypeError: object of type 'NoneType' has no len()
please help me sir
i am working on college project and i need a hotword detection in my python project to start my project
The text was updated successfully, but these errors were encountered: