Przeglądaj źródła

修改驰声插件

rhyme 5 lat temu
rodzic
commit
55e65bca08
1 zmienionych plików z 1 dodań i 9 usunięć
  1. 1 9
      ios/Classes/SpeechPlugin.m

+ 1 - 9
ios/Classes/SpeechPlugin.m

@@ -121,7 +121,7 @@
     [appDic setValue:user_id forKey:@"userId"];
     /*audio音频数据传参*/
     NSMutableDictionary *audioDic = [[NSMutableDictionary alloc] init];
-    [audioDic setValue:@"wav" forKey:@"audioType"];//音频编码格式
+    [audioDic setValue:@"m4a" forKey:@"audioType"];//音频编码格式
     [audioDic setValue:[NSNumber numberWithInt:16000] forKey:@"sampleRate"];//音频采样率
     [audioDic setValue:[NSNumber numberWithInt:1] forKey:@"channel"];//单声道设置
     [audioDic setValue:[NSNumber numberWithInt:2] forKey:@"sampleBytes"];//采样字节数(1-单字节-8位,2-双字节-16位)
@@ -227,15 +227,7 @@
                 printf("read file error!\n");
                 return;
             }
-            //            NSData *voiceData = [M4aToPcmHelper M4aToPcmWithUrl:[[NSURL alloc] initFileURLWithPath:path]];
-            //            NSUInteger len = [voiceData length];
-            //            Byte *bytedata = (Byte*)malloc(len);
-            //            memcpy(bytedata, [voiceData bytes], len);
-            //
-            //            aiengine_feed(_engine, bytedata, len);
-            
             //            fseek(file, 44, SEEK_SET); //wav音频文件需要跳过头文件信息,其它音频格式不需要
-            printf("startFeed\n");
             while ((bytes = (int)fread(buf, 1, 1024, file)))
             {
                 aiengine_feed(_engine, buf, bytes);