首页 > 解决方案 > 如何将音频 (.wav) 文件导入 R?

问题描述

#Read a Wave File
library(readr)
library(tuneR)
#path of file
file_audio_path <- "file_example.wav"
#Read Files
train_audio = readWave(file_audio_path)
#Lets see the structure of the audio.
str(train_audio)

所以我运行它,我得到这个错误:

Error in readWave(file_audio_path) : 
  File 'file_example.wav' does not exist.

我的问题是如何让它识别我文件夹中的音频文件。如何让 R 识别路径?

标签: r

解决方案


推荐阅读