Does anyone know how to set CD/DVD burn speed (e.g. 4x, 10x) using IMAPI2?
Also, I first need to get the speeds supported by the media. How can I retrieve them?
Does anyone know how to set CD/DVD burn speed (e.g. 4x, 10x) using IMAPI2?
Also, I first need to get the speeds supported by the media. How can I retrieve them?
To set the burn speed you can use the method IDiscFormat2Data::SetWriteSpeed from IDiscFormat2Data interface. It lets you request the maximum speed supported by optical media or specify the wanted burning speed.
In order to retrieve the supported write speeds by the burning device and current media you can use the method IDiscFormat2Data::get_SupportedWriteSpeeds
To check the current write speed you have the IDiscFormat2Data::get_CurrentWriteSpeed method.
Those methods use sectors per second instead of 4x, 10x, etc. You can convert from one to another using the following constants:
from imapi2.h header:
#define IMAPI_SECTORS_PER_SECOND_AT_1X_CD 75 #define IMAPI_SECTORS_PER_SECOND_AT_1X_DVD 680 #define IMAPI_SECTORS_PER_SECOND_AT_1X_BD 2195 #define IMAPI_SECTORS_PER_SECOND_AT_1X_HD_DVD 4568
Microsoft initially released IMAPI interface for C#. It had many problems. You can read more about it here. So I am using this source code (written by Eric Haddan on Code Project) instead of the copy that was released by Microsoft. So, you may see some differences with respect to documentation.
Before you interact with write speed (get/set), you need to do some initial actions like setting the recorder. I am assuming you know all this and skipping it in this answer to shorten the length.
To set the burn speed, you optionally need to get the supported write speeds first:
Then, based on received supported values above, you can set the write speed:
In above method, parameter
requestedSectorsPerSecond
is index of string array (write speed) you received from earlier method. You may set rotation type (pure CAV) tofalse
.Following is from Microsoft:
Names of the objects used in code above are according to IMAPI itself. That is why, I am not adding more description about the IMAPI interface. More details are already given by other answer from @rmp.