humlab-speech / superassp

A wrassp super-package that re-exports all the functionality of wrassp, and adds the ability to get Praat and MATLAB signals into SSFF format.
https://humlab-speech.github.io/superassp/
2 stars 1 forks source link

praat_formant_burg is not accepted by emuR::get_trackdata #4

Closed FredrikKarlssonSpeech closed 3 years ago

FredrikKarlssonSpeech commented 4 years ago

The SSFF object returned by praat_formant_burg is problematic somehow.

This code works

> library(emuR)
> create_emuRdemoData()
> load_emuDB(file.path(tempdir(),"emuR_demoData","ae_emuDB")) -> ae
INFO: Loading EMU database from /var/folders/vc/lhvg_40x50l3nb3rndb4kwbm0000gp/T//Rtmpav57sc/emuR_demoData/ae_emuDB... (7 bundles found)
  |====================================================================| 100%
> query(ae,"Phonetic == V") -> vs
> get_trackdata(ae,vs,onTheFlyFunctionName="forest",ssffTrackName = "fm")

but getting the tracks using praat_formant_burg results in an error (after successful processing of 33% of the segment list).

>get_trackdata(ae,vs,onTheFlyFunctionName="praat_formant_burg",ssffTrackName = "fm")

  INFO: applying praat_formant_burg to 3 segments/events
  |=======================                                             |  33%Error in seq.default(fStartTime, curEnd, fSampleRateInMS) : 
  'from' must be of length 1
FredrikKarlssonSpeech commented 3 years ago

More information:

> praat_formant_burg(
+     file.path(getwd(),"tests/signalfiles/msajc003.wav"),toFile=FALSE) -> pf
> str(pf)
List of 2
 $ fm: num [1:461, 1:4] 0 0 0 0 1373 ...
 $ bw: num [1:461, 1:4] 0 0 0 0 960 884 905 694 1330 999 ...
 - attr(*, "trackFormats")= chr [1:2] "INT16" "INT16"
 - attr(*, "sampleRate")= num 160
 - attr(*, "origFreq")= num 20000
 - attr(*, "startTime")= num 0.00223
 - attr(*, "startRecord")= int 1
 - attr(*, "endRecord")= int 457
 - attr(*, "class")= chr "AsspDataObj"
 - attr(*, "fileInfo")= int [1:2] 20 2
 - attr(*, "filePath")= chr "/Users/frkkan96/Documents/src/superassp/tests/signalfiles/msajc003.fms"
> wrassp::forest(
+     file.path(getwd(),"tests/signalfiles/msajc003.wav"),toFile=FALSE) ->ff
> str(ff)
List of 2
 $ fm: int [1:581, 1:4] 0 1239 0 0 0 0 0 0 0 0 ...
 $ bw: int [1:581, 1:4] 0 644 0 0 0 0 0 0 0 0 ...
 - attr(*, "trackFormats")= chr [1:2] "INT16" "INT16"
 - attr(*, "sampleRate")= num 200
 - attr(*, "origFreq")= num 20000
 - attr(*, "startTime")= num 0.0025
 - attr(*, "startRecord")= int 1
 - attr(*, "endRecord")= int 581
 - attr(*, "class")= chr "AsspDataObj"
 - attr(*, "fileInfo")= int [1:2] 20 2

Not sure why the add_ssff trackdata function complains..

FredrikKarlssonSpeech commented 3 years ago

Works now.