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

fix: extremely bogus state align code #34

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
Roadmap:

- 0.4.x: Fix some problems
- Absence of mdef_convert
- Make a general model conversion tool
- Allows us flexibility in model implementation for future
- Documentation deficiencies
- Lack of example for endpointer
- Lack of adapter for endpointer (WebAudio, etc)
- Lack of web audio format support

- 0.5.x: Improve performance/usability
- Phone input/output as IPA
- Optimize JSGF compiler

- 1.0: Finalize API
- ES6 module (possibly separate for Node vs. Web)
- Optimize JSGF compiler
- Support IPA dictionaries
- Improve Endpointer/VAD
- Clearly define use cases and restructure API for them
- Live: feed data asynchronously, check results synchronously or emit events
Expand Down
2 changes: 1 addition & 1 deletion include/soundswallower/state_align_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern "C" {
* History structure
*/
struct state_align_hist_s {
uint16 id;
int32 id;
int32 score;
};
typedef struct state_align_hist_s state_align_hist_t;
Expand Down
6 changes: 5 additions & 1 deletion src/state_align_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ state_align_search_finish(search_module_t *search)
/* Best state exiting the last cur_frame. */
last.id = cur.id = hmm_out_history(final_phone);
last.score = hmm_out_score(final_phone);
if (last.id == 0xffff) {
if (last.id == -1) {
E_ERROR("Failed to reach final state in alignment\n");
return -1;
}
Expand All @@ -235,6 +235,10 @@ state_align_search_finish(search_module_t *search)
/* Look at frame - 2 because we track transitions, I think */
for (cur_frame = sas->frame - 2; cur_frame >= 0; --cur_frame) {
cur = sas->tokens[cur_frame * sas->n_emit_state + cur.id];
if (cur.id == -1) {
E_ERROR("Alignment failed in frame %d\n", cur_frame);
return -1;
}
/* State boundary, update alignment entry for next state. */
if (cur.id != last.id) {
itor = alignment_iter_goto(itor, last.id);
Expand Down