Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-record-audio

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-record-audio

Paquete para la grabacion de contenido con el microfono por defecto del navegador

  • 0.1.16
  • npm
  • Socket score

Version published
Weekly downloads
84
increased by300%
Maintainers
2
Weekly downloads
 
Created
Source

Descripcion

Paquete para la grabacion de contenido con el microfono por defecto del navegador

Instalacion

Instalacion del paquete

npm i vue-record-audio

Configuracion para la Grabacion del Audio

<template>
    <div>
        <RecordsAudio :saveRecord="saveRecord" :iconsRecord="iconsRecord" @listenEventsRecord="listenEventsRecord" @listenEventsPlayer="listenEventsPlayer">
          <!-- control de grabador -->
        <template #btnCancelRecord="{ControllerRecord}">
            <button class="btn btn-sm btn-transparent" @click="ControllerRecord.cancelRecord">
              <IconClose/>
            </button>
        </template>
        <template #btnRecord="{ControllerRecord}">
            <button class="btn btn-primary" @click="ControllerRecord.playAudio">
              <IconMic v-if="!ControllerRecord.record"/>
              <IconPause color="#ffffff" v-else-if="!ControllerRecord.pause" />
              <IconPlay color="#ffffff" v-else/>
            </button>
        </template>
        <template #btnStopRecord="{ControllerRecord}">
            <button class="btn btn-sm btn-transparent" @click="ControllerRecord.stopRecord">
              <IconStop/>
            </button>
        </template>
        <!-- control de player -->
        <template #btnPlayerCancel="{ControllerPlayer}">
            <button class="btn btn-sm btn-transparent" @click="ControllerPlayer.cancelPlay">
              <IconClose/>
            </button>
        </template>
        <template #btnPlayer="{ControllerPlayer}">
            <button class="btn btn-primary" @click="ControllerPlayer.playRecord">
              <IconPause color="#ffffff" v-if="ControllerPlayer.play"/>
              <IconPlay color="#ffffff" v-else-if="ControllerPlayer.pause" />
              <IconPlay color="#ffffff" v-else/>
            </button>
        </template>
        <template #btnPlayerStop="{ControllerPlayer}">
            <button class="btn btn-sm btn-transparent" @click="ControllerPlayer.stopPlay">
              <IconStop/>
            </button>
        </template>
      </RecordsAudio>
    </div>
</template>
<script setup lang="ts">
import { RecordsAudio,IconClose,IconStop,IconMic,IconPlay,IconPause,IconDeVol,IconInVol } from "vue-record-audio"
const saveRecord = (data:any) => {
    console.log(data)
}
const listenEventsRecord = (data:any)=>{
  console.log("listen record",data)
}
const listenEventsPlayer = (data:any)=>{
  console.log("listen player",data)
}
</script>
<style>
 @import url(/node_modules/vue-record-audio/dist/style.css);
</style>

Configuracion reproducir audio sin grabacion

<template>
    <div>
    <RecordAudio :playAudioBase64="playAudioBase64" :justPlay="true" @listenEventsPlayer="listenEventsPlayer">
        <template #btnPlayerCancel="{ControllerPlayer}">
            <button class="btn btn-sm btn-transparent" @click="ControllerPlayer.cancelPlay">
              <IconClose/>
            </button>
        </template>
        <template #btnPlayer="{ControllerPlayer}">
            <button class="btn btn-primary" @click="ControllerPlayer.playRecord">
              <IconPause color="#ffffff" v-if="ControllerPlayer.play"/>
              <IconPlay color="#ffffff" v-else-if="ControllerPlayer.pause" />
              <IconPlay color="#ffffff" v-else/>
            </button>
        </template>
        <template #btnPlayerStop="{ControllerPlayer}">
            <button class="btn btn-sm btn-transparent" @click="ControllerPlayer.stopPlay">
              <IconStop/>
            </button>
        </template>
    </RecordAudio>
    </div>
</template>
<script setup lang="ts">
import { RecordsAudio,IconClose,IconStop,IconMic,IconPlay,IconPause,IconDeVol,IconInVol} from "vue-record-audio"
const playAudioBase64:"//vUxAADwAABpAAAAC...."

const listenEventsPlayer = (data:any)=>{
  console.log("listen player",data)
}
</script>

<style>
 @import url(/node_modules/vue-record-audio/dist/style.css);
</style>

Subir Archivo de Audio

En la parte superior derecha se tiene un boton para subir un archivo de audio, ni bien se suba un archivo este llamara al evento saveRecord y devolvera el base64

Keywords

FAQs

Package last updated on 15 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc