mirror of
https://github.com/Tony0410/News-reader-pro.git
synced 2026-05-24 13:21:40 +08:00
Sets up the foundational elements for the NewsCaster AI application. This includes: - Initializing the project with Vite and React. - Defining core types for articles and player state. - Configuring build tools and TypeScript. - Adding essential dependencies like React, Vite, and Google's Gemini API client. - Providing initial README instructions for running locally. - Setting up basic styling and structure in index.html. - Defining available voices and playback constants. - Implementing utility functions for audio handling.
35 lines
683 B
TypeScript
35 lines
683 B
TypeScript
export enum VoiceName {
|
|
Puck = 'Puck',
|
|
Charon = 'Charon',
|
|
Kore = 'Kore',
|
|
Fenrir = 'Fenrir',
|
|
Zephyr = 'Zephyr',
|
|
}
|
|
|
|
export enum PlaybackStatus {
|
|
IDLE = 'IDLE',
|
|
LOADING_TEXT = 'LOADING_TEXT',
|
|
LOADING_AUDIO = 'LOADING_AUDIO',
|
|
READY = 'READY',
|
|
PLAYING = 'PLAYING',
|
|
PAUSED = 'PAUSED',
|
|
ERROR = 'ERROR',
|
|
COMPLETED = 'COMPLETED'
|
|
}
|
|
|
|
export interface Article {
|
|
id: string;
|
|
url: string;
|
|
title: string;
|
|
text: string;
|
|
audioUrl?: string; // Blob URL for the WAV file
|
|
status: PlaybackStatus;
|
|
errorMessage?: string;
|
|
}
|
|
|
|
export interface PlayerState {
|
|
isPlaying: boolean;
|
|
playbackRate: number;
|
|
currentArticleId: string | null;
|
|
selectedVoice: VoiceName;
|
|
} |