0.1.19 • Published 1 year ago

vue-record-audio v0.1.19

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

0.1.19

1 year ago

0.1.15

2 years ago

0.1.16

2 years ago

0.1.17

2 years ago

0.1.18

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago