library(av)
library(ggplot2)
tnsdt <- read_audio_fft("tnsfl.mp3")
av_audio_convert(tnsfl, 'tnsfl.wav', channels = 1, start_time = 840, end_time =900)
tm <- attr(tnsdt, "time")
fq1_50 <- colSums(tnsdt[1:50,]) / 50
fq100_200 <- colSums(tnsdt[100:200, ]) / 100
fq300_400 <- colSums(tnsdt[300:400, ]) / 100
fq350_450 <- colSums(tnsdt[350:425, ]) / 100
fqall <- colSums(tnsdt[1:512, ]) / 512
dt <- data.frame(tm, fq1_50, fq100_200, fq300_400, fq350_450, fqall)
ggplot(dt, aes(x = tm, y = fq100_200)) + geom_line()
library(plotly)
plot_ly(dt, x = ~tm, y = ~fq300_400, type = "scatter", mode = "lines", name = "300-400") %>%
add_trace(y = fq350_450, name = "350-450") %>%
add_trace(y = fq1_50, name = "1-50")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.