1111import scipy .io .wavfile as spiowav
1212
1313def audio_read (fullpath_aq8_rec_or_wav , start_tic , stop_tic ,
14- nchan = 8 , ncomments = 3 , Fs = "smpl.frq= ([0-9.,]+)Hz" , mmap = True , ** kw ):
14+ nchan = 8 , ncomments = 3 , Fs = "smpl.frq= + ([0-9.,]+)Hz" , mmap = True , ** kw ):
1515 if not start_tic : start_tic = 0
1616 ext = os .path .splitext (fullpath_aq8_rec_or_wav )[1 ]
1717
@@ -22,7 +22,7 @@ def audio_read(fullpath_aq8_rec_or_wav, start_tic, stop_tic,
2222 for _ in range (ncomments ):
2323 line = fid .readline ().decode ()
2424 m = re .search (Fs , line )
25- if m : sampling_rate = float (m .group (1 ).replace ("," , "." ))
25+ if m : sampling_rate = round ( float (m .group (1 ).replace ("," , "." ) ))
2626 n0 = fid .tell ()
2727 n1 = fid .seek (0 ,2 )
2828 nsamples = (n1 - n0 )// 4 // nchan
@@ -61,7 +61,7 @@ def audio_read(fullpath_aq8_rec_or_wav, start_tic, stop_tic,
6161 for _ in range (ncomments ):
6262 line = fid .readline ().decode ()
6363 m = re .search (Fs , line )
64- if m : sampling_rate = float (m .group (1 ).replace ("," , "." ))
64+ if m : sampling_rate = round ( float (m .group (1 ).replace ("," , "." ) ))
6565 n0 = fid .tell ()
6666 n1 = fid .seek (0 ,2 )
6767 nsamples = (n1 - n0 )// 4
0 commit comments