mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
change int2float
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
" abs_max = np.abs(sound).max()\n",
|
" abs_max = np.abs(sound).max()\n",
|
||||||
" sound = sound.astype('float32')\n",
|
" sound = sound.astype('float32')\n",
|
||||||
" if abs_max > 0:\n",
|
" if abs_max > 0:\n",
|
||||||
" sound *= 1/abs_max\n",
|
" sound *= 1/32768\n",
|
||||||
" sound = sound.squeeze()\n",
|
" sound = sound.squeeze()\n",
|
||||||
" return sound\n",
|
" return sound\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
" abs_max = np.abs(sound).max()\n",
|
" abs_max = np.abs(sound).max()\n",
|
||||||
" sound = sound.astype('float32')\n",
|
" sound = sound.astype('float32')\n",
|
||||||
" if abs_max > 0:\n",
|
" if abs_max > 0:\n",
|
||||||
" sound *= 1/abs_max\n",
|
" sound *= 1/32768\n",
|
||||||
" sound = sound.squeeze() # depends on the use case\n",
|
" sound = sound.squeeze() # depends on the use case\n",
|
||||||
" return sound"
|
" return sound"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user