Как загрузить аудиофайл путем модернизации?
Я привел некоторые классы и код, который я написал, но я не ответил на эти коды
Интерфейс:
@Multipart
@POST("comments")
Call<Wallet> setComent(@Part("voice") RequestBody song, @Part("api_token") String api_token, @Part("product") String product, @Part("body") String body);
Класс:
AudioSavePathInDevice =
Environment.getExternalStorageDirectory().getAbsolutePath() + "/" +
"NAME" + "AudioRecording.mp3";
File file = new File(AudioSavePathInDevice );
//creating request body for file
RequestBody requestFile = RequestBody.create(MediaType.parse("audio/*"), file);
MyInterFace myInterFace = MyServices.createService(MyInterFace.class);
Call<Wallet> calling = myInterFace.setComent
(requestFile,new AppStore(getContext()).LoadMyShereKES(AppStore.Keys_TOKEN),AppStore.ID_BACHGROUD,Ediet.getText().toString());
calling.enqueue(new Callback<Wallet>()
{
@Override
public void onResponse( Call<Wallet> call, Response<Wallet> response)
{
appStore.CloseDilag();
}
@Override
public void onFailure(Call<Wallet> call, Throwable t)
{
appStore.CloseDilag();
}
});
![enter image description here](https://i.stack.imgur.com/aR651.png)