Skip to content

Failed to reach final state in alignment #339

@mharvilla

Description

@mharvilla

I am using Python PocketSphinx 5.0.0 for US English forced alignment. Unfortunately, I am frequently encountering the following error when doing alignments, despite the transcript being correct and the recording being free of noise.

ERROR: "state_align_search.c", line 228: Failed to reach final state in alignment
Failed on second-pass alignment: Failed to stop utterance processing

The following is a code snippet from my project which does the actual alignment using PocketSphinx.

if self._transcript:
    try:
        self.decoder.start_utt()
        self.decoder.process_raw(raw_audio, full_utt=True)
        self.decoder.end_utt()
    except RuntimeError as e:
        print(f'Failed on first-pass alignment: {e}')

    try:
        self.decoder.set_alignment()
    except RuntimeError as e:
        print(f'Failed to set alignment: {e}')

    try:
        self.decoder.start_utt()
        self.decoder.process_raw(raw_audio, full_utt=True)
        self.decoder.end_utt()
    except RuntimeError as e:
        print(f'Failed on second-pass alignment: {e}')

    self.alignment = self.parse_alignment(self.decoder.get_alignment())

As you can see, the final try-except block is being tripped.

Is there a way to loosen some parameters in PocketSphinx so that it can at least produce an alignment (even if suboptimal) without throwing an exception? I cannot find anything in the docs.

P.S. I am aware that there are better tools out there for FA, but this lightweight library is expedient to work with at the moment.

Thanks in advance for any advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions