punjabi-voice-search
Advanced tools
Comparing version 2.0.2 to 2.0.4
import PunjabiVoiceSearch from './PunjabiVoiceSearch'; | ||
export { PunjabiVoiceSearch }; |
@@ -0,0 +0,0 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; |
import PunjabiVoiceSearch from './PunjabiVoiceSearch'; | ||
export { PunjabiVoiceSearch }; |
@@ -0,0 +0,0 @@ import React from "react"; |
declare const _default: import("vite").UserConfig; | ||
export default _default; |
@@ -0,0 +0,0 @@ import { defineConfig } from "vite"; |
{ | ||
"name": "punjabi-voice-search", | ||
"version": "2.0.2", | ||
"version": "2.0.4", | ||
"description": "Returns punjabi language transcript using google speech-to-text api.", | ||
@@ -29,2 +29,3 @@ "main": "dist/punjabi-voice-search.cjs.js", | ||
"devDependencies": { | ||
"@types/node": "^22.7.5", | ||
"@types/react": "^18.0.27", | ||
@@ -31,0 +32,0 @@ "@types/react-dom": "^18.0.10", |
@@ -17,25 +17,44 @@ # Punjabi Voice Search | ||
Works with audioData in base64 string format. | ||
```js | ||
import PunjabiVoiceSearch from 'punjabi-voice-search'; | ||
import React, { useState } from 'react'; | ||
import PunjabiVoiceSearch from 'punjabi-voice-search'; // Import from your package | ||
const [transcript, setTranscript] = useState<string | null>(null); | ||
const App: React.FC = () => { | ||
const [transcript, setTranscript] = useState<string>(''); // For managing transcript state | ||
// Function to handle the transcript received from the API | ||
const handleTranscript = (transcript: string) => { | ||
setTranscript(transcript); | ||
console.log("Transcript received:", transcript); | ||
return ( | ||
<div> | ||
<h1>Punjabi Voice Search Example</h1> | ||
{/* Using PunjabiVoiceSearch with initials as false */} | ||
<h2>Transcript Mode</h2> | ||
<PunjabiVoiceSearch | ||
initials={false} // Transcript mode | ||
micSize={40} | ||
state={transcript} // Pass transcript state | ||
setState={setTranscript} // Set transcript state | ||
/> | ||
{/* Using PunjabiVoiceSearch with initials as true */} | ||
<h2>Gurbani Mode</h2> | ||
<PunjabiVoiceSearch | ||
initials={true} // Gurbani search mode | ||
micSize={40} | ||
state={transcript} // Pass transcript state | ||
setState={setTranscript} // Set transcript state | ||
/> | ||
{/* Displaying the transcript */} | ||
{transcript && ( | ||
<div> | ||
<h3>Transcript Output:</h3> | ||
<p>{transcript}</p> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
<PunjabiVoiceSearch | ||
initials={false} // Set to false for transcript-only mode | ||
onTranscript={handleTranscript} // Callback to get the transcript from API | ||
/> | ||
export default App; | ||
<PunjabiVoiceSearch | ||
initials={true} // Set to true for Gurbani search mode | ||
micSize={40} // Optional: Size of the microphone icon | ||
onTranscript={handleTranscript} // Callback to get the transcript from API | ||
/> | ||
``` | ||
@@ -42,0 +61,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74989
92
6