傳輸音頻

 
private Strin我如今是利用webservice中的協議進行傳輸的,將客戶端錄製的音頻傳輸到服務器端 g DecodeToSting(String PictureName) { // 將圖片轉化成Bitmap String imageFilePath = PHOTO_PATH + "/" + PictureName; BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 10; // 圖片縮小到1/100 Bitmap bm = BitmapFactory.decodeFile(imageFilePath, options); // 將Bitmap轉化成String String string = null; ByteArrayOutputStream bStream = new ByteArrayOutputStream(); bm.compress(CompressFormat.JPEG, 100, bStream); byte[] bytes = bStream.toByteArray(); string = Base64.encodeToString(bytes, Base64.DEFAULT); return string; }圖片我是這麼轉換的 實際上是將二進制流轉化爲了字符串在傳
相關文章
相關標籤/搜索