From a3342697e4975f2c87cd0eaefcb0283db4588fde Mon Sep 17 00:00:00 2001 From: Jiajun Date: Tue, 15 Aug 2023 18:12:45 +0200 Subject: [PATCH] Add resample example --- assets/voice24khz.mp3 | Bin 0 -> 3072 bytes examples/resample.rs | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 assets/voice24khz.mp3 create mode 100644 examples/resample.rs diff --git a/assets/voice24khz.mp3 b/assets/voice24khz.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..13107ec43fa7d2cca5b418fd9e6054aa6b78b66b GIT binary patch literal 3072 zcmcK6do+|=8vyWkkTfAPE(f_z;#pZ~t~J^$>zp1s#^@Aa&`p0&Xht4;s_1Z`nB000kN z-_iHnW^v6~Cy{yM$8X((_a?3cO3C~ZvGJRC&bSu$!0I@-;Pqy6He~p``Q~k!l^y@( z?cdg5f0@Tu8=^A^uCz>z+{-hIk~YiN$Q&da4}sgh8`6Ir2V-c$x>BD@Y}`iIzF8b* zHicP^aQ5^{E1~aVgs`t9@X7D~yu9i-i!S^_+xtoBP8p17>BeI{;t@n`5t~&y_I1CV zluKhP`$QTe^F)(W6Q9F8|_) z{Zyk{0OAjOl|#PP-WBx{81)>G^m2?gzCK@6AM{G`U_n92QBK4)@I9Pd7#y%*m*1C# zI;9aHj80yDYHtpHeo*kteb5IPPLYIhF-eVQ)ae82yAxFfQQ$cEPqb_#Y>(T%m~@YP zH>}MFcCwd$ulVfh-1UGDkqE8M)P@I^DPjXJ%HchtyM>t#Q!1`T2vQa3K><=xH-}x@ zaZ6`YmQ`*^l}yYzVQiVM9fWV~lb#0QS?J^;@RiRt4&H`*5y@=fPC&$k4P^Up{Nmi} zz^d7G2Do^GH4`>e+YA7{*+677-|WF9Z}{wNvCG#ahMx;^Ca6Oc@VKCElblQbBslr-0fC$`-ou zl+ly0#(LXZ$K|wE|HetQ3xCnWs!Uj+#tKDX_BFU?A_~f{!mmL7USv|~Q=q^#M>|XN zvFxk)bZL1jF4oVY_O6t}$o&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