Добавление аудио к точкам точечных диаграмм в блестящей панели инструментов - PullRequest
0 голосов
/ 15 января 2020

У меня есть данные о голосах и эмоциях. Используя блестящий, я хочу создать график рассеяния с всплывающей подсказкой, которая показывает название и тип эмоций и запускает аудиофайл. Когда люди нажимают на точку, я хочу услышать звук этой эмоции. Тем не менее, я не могу найти решение для запуска аудиофайла. Аудио файлы в формате WAV. В основном, я хочу знать, как я добавляю аудио файлы в hoover или подсказку. Я использовал пакет hchart для создания графика.

Это серверная часть моего блестящего приложения

require(shinydashboard)
require(ggplot2)
require(dplyr)
require(highcharter) 
library(readxl)
require(tidyr)

server <- function(input, output) {  




  output$hcontainer <- renderHighchart ({

    data_frame <- data %>% filter(Language == input$language & acoustics == input$acoustic_parameter) 


    ##plot, ADD audio file for points
    hchart(data, "scatter", hcaes(x = Emotion , y = values, group = Vocalization)) %>%
      hc_exporting(enabled = TRUE) %>% 
      hc_tooltip(crosshairs = TRUE, backgroundColor = "#FCFFC5",
                 shared = TRUE, borderWidth = 2) %>%
      hc_title(text="Acoustic Parameter",align="center") %>%
      hc_subtitle(text="Emotion - Vocalization Graph",align="center") %>%
      hc_add_theme(hc_theme_elementary())

  })

}

Это коды для пользовательского интерфейса

##required packages.

library(shinydashboard)
require(shiny)
require(highcharter)

##there is two input, language: Dutch, Chinese, acoustic parameter: 10 different, 

language <- c("Dutch", "Chinese") 
acoustic_parameter <- c("loudness_sma3_amean",
                        "loudness_sma3_pctlrange0-2",
                        "mfcc3_sma3_amean",
                        "F1amplitudeLogRelF0_sma3nz_amean",
                        "hammarbergIndexV_sma3nz_amean",
                        "F0semitoneFrom27.5Hz_sma3nz_percentile20.0",
                        "loudness_sma3_percentile50.0",
                        "mfcc1_sma3_amean",
                        "HNRdBACF_sma3nz_amean",
                        "F2amplitudeLogRelF0_sma3nz_amean")


dashboardPage(
  #defines header of dashboard
  skin = "red",
  dashboardHeader(
    title="Shiny Project Deneme" ,
    dropdownMenu()
  ),

  ##define sidebar 
  dashboardSidebar(
    sidebarMenu(
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("About", tabName = "about", icon = icon("th")),
      menuItem("Project",tabName="unions",icon=icon("signal"))

    )
  ),
  ##defines body

  dashboardBody(
    tags$head(
      tags$link(rel = "stylesheet", type = "text/css", href = "custom.css")
    ),

    #First TAB Menu-Dashboard  
    tabItem(tabName = "dashboard",

            fluidRow(




              column(12,
                     box(selectInput("language", label = "Language", choices = language))),
              column(12,
                     box(selectInput("acoustic_parameter", label = "acoustic parameter", choices = acoustic_parameter))),

              column(12,

                     box(

                       highchartOutput("hcontainer"),

                        width="12") #end of the box
              ), #close the column

          hr(),
          h4("Plot of the these Project", align = "center"),
          br(),
          column(12, 

                 box(
                   highchartOutput("hc2"), width=12
                 ))
            ), ## close the row 

          h4("First trial", strong("Alkim Karakurt")), 

    ), # close the first tab item 

    #second tab menu 
      tabItem(tabName = "about", 
              fluidPage(
      br(),
      br(),
      box(width = 12, height = "300px",
          p(style ="font-size:18px", strong("Center for Data Science"), "Project Type"),

          ) #close box
              ) #close fluid
      ), #close tab item


  )

)
...