0.1.19 • Published 4 months ago

vue-record-audio v0.1.19

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months 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

4 months ago

0.1.15

6 months ago

0.1.16

6 months ago

0.1.17

6 months ago

0.1.18

5 months ago

0.1.14

7 months ago

0.1.13

7 months ago

0.1.12

8 months ago

0.1.11

8 months ago

0.1.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago