Giter Site home page Giter Site logo

Comments (5)

zhw2590582 avatar zhw2590582 commented on June 19, 2024 1

@yuguaa @Rahulk4128
Or use openai's whisper, which is simpler to use and cheaper.

from wfplayer.

zhw2590582 avatar zhw2590582 commented on June 19, 2024

wfplayer itself can create multiple instances

const wf1 = new WFPlayer({...});
const wf2 = new WFPlayer({...});

from wfplayer.

Rahulk4128 avatar Rahulk4128 commented on June 19, 2024

Thank you very much for your quick response. but the issue is resolved now. Actually, I have to create an instance on runtime. here is a code sample.
let playerRefArray = [];
(Array).forEach((element, index) => {
playerRefArray[index] = new WFPlayer({
container: document.querySelector(#waveform-${element}),
mediaElement: document.querySelector(#audio-${element}),
wave: true,
// Waveform color
waveColor: 'rgba(255, 255, 255, 0.1)',

				// Background color
				backgroundColor: 'rgb(28, 32, 34)',

				// Whether to display cursor
				cursor: true,

				// Cursor color
				cursorColor: '#ff0000',

				// Whether to display progress
				progress: true,

				// progress color
				progressColor: 'rgba(255, 255, 255, 0.5)',

				// Whether to display grid
				grid: false,

				// Grid color
				gridColor: 'rgba(255, 255, 255, 0.05)',

				// Whether to display ruler
				ruler: true,

				// Ruler color
				rulerColor: 'rgba(255, 255, 255, 0.5)',

				// Whether to display ruler at the top
				rulerAtTop: true,

				// Indicates whether to do http fetching with cookies
				withCredentials: false,

				// Indicates whether to enable CORS for http fetching
				cors: true,

				// Initialize http headers
				headers: {},

				// Pixel ratio
				pixelRatio: window.devicePixelRatio,

				// Which audio channel to render
				channel: 0,

				// Duration of rendering
				duration: 10,

				// The ratio of spaces on both sides
				padding: 0,

				// Waveform height scale ratio
				waveScale: 0.7,
			});
			playerRefArray[index].on('click', (currentTime) => {
				playerRefArray[index].seek(currentTime);
			});
			playerRefArray[index].on('grabbing', (currentTime) => {
				playerRefArray[index].seek(currentTime);
			});
			// scroll event
			playerRefArray[index].on('scroll', (deltaY) => {
				playerRefArray[index].seek(
					playerRefArray[index].currentTime + deltaY / 10,
				);
			});
			playerRefArray[index].load(
				document.querySelector(`#audio-${element}`),
			);
		});
		
		//for destroying the instance ====>this important 
			(Array).forEach((element, index) => {
				playerRefArray[index].destroy();
			});

from wfplayer.

Rahulk4128 avatar Rahulk4128 commented on June 19, 2024

@zhw2590582 can you guide me on extracting subtitles or transcripts from the audio file? Do wfplayer.js support this feature
Please mark this question as a priority. Thanks in advance.

from wfplayer.

yuguaa avatar yuguaa commented on June 19, 2024

@zhw2590582 can you guide me on extracting subtitles or transcripts from the audio file? Do wfplayer.js support this feature Please mark this question as a priority. Thanks in advance.

Audio text recognition is a significant project, and it is recommended to purchase third-party services. I am using Tencent's audio-to-text service and need to pay the corresponding fees.

from wfplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.