Merge pull request #313 from snakers4/adamnsandle

change int2float
This commit is contained in:
Dimitrii Voronin
2023-03-28 17:31:27 +03:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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",

View File

@@ -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"
] ]