Skip to content

Latest commit

 

History

History

audio-react

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@labelu/audio-react

npm

安装

npm install @labelu/audio-react

使用

example

import React from 'react';
import Audio from '@labelu/audio-react';

function App() {
  const [annotations, setAnnotations] = useState([]);
  return (
    <AudioAnnotator
      editingLabel="abc"
      src="https://exmaple/audio.mp3"
      editingType="segment"
      annotations={annotations}
      toolConfig={{
        segment: [
          {
            type: 'segment',
            attributes: [
              {
                color: '#ff0000',
                type: 'string',
                key: 'label',
                value: 'abc',
              },
            ],
          },
        ],
      }}
      onChange={setAnnotations}
    />
  );
}

API

Documentation