Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Python exit with code 139 (interrupted by signal 11: SIGSEGV) when supplying -samprate argument #23

Closed
dieka13 opened this issue Feb 20, 2017 · 1 comment

Comments

@dieka13
Copy link

dieka13 commented Feb 20, 2017

I'm trying to set the decoder into 8000 Hz sampling rate, but got output:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
with below code:

import os
from pocketsphinx import DefaultConfig, Decoder, get_model_path, get_data_path

model_path = get_model_path()
data_path = get_data_path()

# Create a decoder with a certain model
config = DefaultConfig()
config.set_string('-hmm', 'stt.cd_ptm_200')
config.set_string('-lm', 'stt.lm.bin')
config.set_string('-dict', 'stt.dict')
config.set_string('-samprate', '8000')
decoder = Decoder(config)

# Decode streaming data
buf = bytearray(1024)
with open(os.path.join(data_path, 'goforward.raw'), 'rb') as f:
    decoder.start_utt()
    while f.readinto(buf):
        decoder.process_raw(buf, False, False)
    decoder.end_utt()
print('Best hypothesis segments:', [seg.word for seg in decoder.seg()])
@nshmyrev
Copy link

Use config.set_float('-samprate', 8000.0) instead

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

No branches or pull requests

2 participants