ByteScout PDF Extractor SDK - C# - Extract Audio - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – C# – Extract Audio

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Extract Audio

ByteScout PDF Extractor SDK – C# – Extract Audio

Program.cs

using Bytescout.PDFExtractor;

namespace ExtractAudio
{
	class Program
	{
		static void Main(string[] args)
		{
            // Create Bytescout.PDFExtractor.MultimediaExtractor instance
            MultimediaExtractor extractor = new MultimediaExtractor();
			extractor.RegistrationName = "demo";
			extractor.RegistrationKey = "demo";
			
			// Load PDF document
            // (!) We do not provide the sample document, please load your own.
            extractor.LoadDocumentFromFile(@"sample-audio.pdf");

			int i = 0;

			// Initialize sound clips enumeration
			if (extractor.GetFirstAudio())
			{
				do
				{
					string outputFileName = "audio" + i + extractor.GetCurrentAudioExtension();

					// Save sound clip to file
					extractor.SaveCurrentAudioToFile(outputFileName);

					i++;
				}
				while (extractor.GetNextAudio()); // Advance sounds enumeration
			}

			// Cleanup
			extractor.Dispose();
		}
	}
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next