> ## Documentation Index
> Fetch the complete documentation index at: https://docs.youka.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Projects

> मीडिया अपलोड करें और कराओके प्रोजेक्ट्स बनाएँ, निरीक्षण करें, सूचीबद्ध करें और हटाएँ

Projects Youka में शीर्ष-स्तरीय संसाधन हैं। प्रत्येक प्रोजेक्ट अपनी source फ़ाइल, अलग किए गए stems, synced lyrics, exports, और project settings का स्वामी होता है।

## एक प्रोजेक्ट बनाना

अधिकांश मामलों में, `client.projects.create()` का उपयोग करें — यह आपके लिए uploads संभालता है।

```ts theme={null}
const operation = await client.projects.create({
  source: { type: "path", path: "./song.mp3" },
  lyricsSource: { type: "transcribe" },
});
// => ProjectOperation
```

### Source types

<Tabs>
  <Tab title="path">
    डिस्क से एक फ़ाइल पढ़ता है।

    ```ts theme={null}
    source: {
      type: "path",
      path: "./song.mp3",
      contentType: "audio/mpeg", // optional, inferred if omitted
    }
    ```
  </Tab>

  <Tab title="bytes">
    इन-मेमोरी `Blob`, `File`, `ArrayBuffer`, या `Uint8Array`।

    ```ts theme={null}
    source: {
      type: "bytes",
      data: fileBuffer,
      filename: "song.mp3",
      contentType: "audio/mpeg", // optional
    }
    ```
  </Tab>

  <Tab title="url">
    रिमोट HTTP या HTTPS URL।

    समर्थित hosted pages yt-dlp पर निर्भर करते हैं। [supported URLs list](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) देखें।

    ```ts theme={null}
    source: {
      type: "url",
      url: "https://example.com/song.mp4",
      maxVideoQuality: "1080p", // optional: "720p", "1080p", "4k", or "best"
    }
    ```

    `maxVideoQuality` URL sources के लिए डाउनलोड की जाने वाली अधिकतम वीडियो गुणवत्ता नियंत्रित करता है। इसका डिफ़ॉल्ट `1080p` है। SDK उस सीमा तक उपलब्ध सर्वोत्तम गुणवत्ता का उपयोग करता है, और यदि प्लेटफ़ॉर्म capped stream उपलब्ध नहीं कराता, तो उपलब्ध सर्वोत्तम फ़ॉर्मेट पर fallback करता है। बिना cap के लिए `best` का उपयोग करें।

    <Note>
      Node.js और Bun पर, SDK पहले उपयोग पर आवश्यक URL dependency binaries (`ffmpeg`, `ffprobe`, `yt-dlp`) को अपने-आप सुनिश्चित करता है। CLI समकक्ष `youka deps ensure --for url` है।
    </Note>
  </Tab>
</Tabs>

### अन्य फ़ील्ड्स

<ParamField path="title" type="string">
  प्रोजेक्ट का शीर्षक। डिफ़ॉल्ट रूप से source filename।
</ParamField>

<ParamField path="splitModel" type="SplitModel">
  Stem separation मॉडल। डिफ़ॉल्ट `mdx23c`। [Split model
  reference](/hi/desktop/split-model) देखें।
</ParamField>

<ParamField path="presetId" type="string">
  निर्माण के समय एक reusable preset लागू करें।
</ParamField>

<ParamField path="lyricsSource" type="LyricsSource">
  lyrics sync कॉन्फ़िगर करें। नीचे देखें।
</ParamField>

### Lyrics sources

```ts theme={null}
// Transcribe lyrics from the audio
lyricsSource: {
  type: "transcribe",
  syncModel: "audioshake-transcription", // optional
  language: "en",                        // optional
}

// Align exact lyrics to the audio
lyricsSource: {
  type: "align",
  lyrics: "First line\nSecond line\n...",
  syncModel: "audioshake-alignment",
}

```

## `client.projects.create(input, options?)`

`client.projects.create()` एक low-level `inputFile` source भी स्वीकार करता है जब आपके पास पहले से एक uploaded `inputFileId` हो।

```ts theme={null}
const upload = await client.uploads.create({
  filename: "song.mp3",
  contentType: "audio/mpeg",
  contentLength: buffer.byteLength,
});

await client.uploads.upload(upload.uploadUrl, buffer, {
  contentType: "audio/mpeg",
});

const operation = await client.projects.create({
  source: {
    type: "inputFile",
    inputFileId: upload.inputFileId,
    filename: "song.mp3",
  },
  title: "My Song",
});
```

## `client.projects.quote(input, options?)`

प्रोजेक्ट बनाए बिना, प्रोजेक्ट बनाने के लिए आवश्यक credits का quote निकालें।

```ts theme={null}
const quote = await client.projects.quote({
  source: { type: "path", path: "./song.mp3" },
  lyricsSource: { type: "transcribe", language: "en" },
  splitModel: "mdx23c",
});

console.log(quote.creditsRequired, quote.sufficientBalance);
```

`client.projects.quote(...)` वही `source` forms स्वीकार करता है जो
`client.projects.create(...)` करता है, जिसमें URL `maxVideoQuality` भी शामिल है। यदि आपको पहले से मीडिया duration पता है और आप quote के लिए सिर्फ़ फ़ाइल अपलोड नहीं करना चाहते, तो low-level REST shape पास करें:

```ts theme={null}
const quote = await client.projects.quote({
  durationSeconds: 210,
  lyricsSource: null,
  splitModel: "mdx23c",
});
```

## `client.uploads.create(body, options?)`

एक upload slot allocate करें और एक signed URL प्राप्त करें।

```ts theme={null}
const upload = await client.uploads.create({
  filename: "song.mp3",
  contentType: "audio/mpeg",
  contentLength: 4_521_344,
});
// => { inputFileId, uploadUrl }
```

## `client.uploads.upload(uploadUrl, body, options?)`

signed URL पर फ़ाइल bytes को PUT करें।

```ts theme={null}
await client.uploads.upload(upload.uploadUrl, fileBuffer, {
  contentType: "audio/mpeg",
  signal: abortController.signal,
});
```

<ParamField path="body" type="FetchBody" required>
  कोई भी `fetch`-compatible body: `Blob`, `File`, `ArrayBuffer`, `Uint8Array`,
  `ReadableStream`, या `string`।
</ParamField>

यदि upload non-2xx status लौटाता है, तो code `UPLOAD_FAILED` के साथ `YoukaRequestError` throw होता है।

## `client.projects.get(projectId, options?)`

पूरा project state प्राप्त करें, जिसमें stems, lyrics, और exports शामिल हैं।

```ts theme={null}
const project = await client.projects.get("prj_abc123");
console.log(project.title, project.stems, project.lyrics);
```

## `client.projects.update(projectId, body, options?)`

प्रोजेक्ट metadata को patch करें।

```ts theme={null}
const project = await client.projects.update("prj_abc123", {
  title: "Updated title",
  artists: ["Artist name"],
});
```

`title` या `artists` में से कम-से-कम एक पास करें।

## `client.projects.list(options?)`

authenticated account के स्वामित्व वाले हर प्रोजेक्ट की सूची दें।

```ts theme={null}
const projects = await client.projects.list();
projects.forEach((p) => console.log(p.id, p.title));
```

project list items का एक array लौटाता है (`getProject` की तुलना में एक leaner shape)।

## `client.projects.delete(projectId, options?)`

एक प्रोजेक्ट और उससे जुड़े सभी stems, lyrics, और exports हटाएँ।

```ts theme={null}
await client.projects.delete("prj_abc123", {
  idempotencyKey: "delete-prj_abc123",
});
```

<Warning>
  deletion स्थायी है। retries सुरक्षित रखने के लिए idempotency key के साथ जोड़ें।
</Warning>

## आगे क्या

* [Stems](/hi/sdk/stems) — stem separation फिर से चलाएँ
* [Lyrics sync](/hi/sdk/lyrics-sync) — lyrics को फिर से sync करें
* [Exports](/hi/sdk/exports) — तैयार वीडियो render करें
* [Tasks](/hi/sdk/tasks) — `client.projects.wait` के साथ project operations का इंतज़ार करें
